home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-11-29 | 16.4 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| MS-DOS Code Page Info (other/dosCodePage)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Fri Nov 29 23:00:00 1996, modified Fri Nov 29 23:00:00 1996, creator Think C, type ASCII, 15513 bytes "pixelize.cp" , at 0x3d19 992 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 70 69 78 65 6c 69 | 7a 65 2e 63 70 00 00 00 |..pixeli|ze.cp...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 3c 99 00 | 00 03 e0 ae c5 61 c0 ae |.....<..|.....a..|
|00000060| c5 61 c0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.a......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 34 28 00 00 |........|....4(..|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 3c 61 73 73 65 72 74 |#include| <assert|
|00000090| 2e 68 3e 0d 0d 23 69 6e | 63 6c 75 64 65 20 3c 66 |.h>..#in|clude <f|
|000000a0| 73 74 72 65 61 6d 2e 68 | 3e 0d 23 69 6e 63 6c 75 |stream.h|>.#inclu|
|000000b0| 64 65 20 3c 73 74 72 73 | 74 72 65 61 6d 2e 68 3e |de <strs|tream.h>|
|000000c0| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 3c 54 79 70 65 |..#inclu|de <Type|
|000000d0| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 4d |s.h>.#in|clude <M|
|000000e0| 65 6d 6f 72 79 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |emory.h>|.#includ|
|000000f0| 65 20 3c 51 75 69 63 6b | 44 72 61 77 2e 68 3e 0d |e <Quick|Draw.h>.|
|00000100| 23 69 6e 63 6c 75 64 65 | 20 3c 4f 53 55 74 69 6c |#include| <OSUtil|
|00000110| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 54 |s.h>.#in|clude <T|
|00000120| 6f 6f 6c 55 74 69 6c 73 | 2e 68 3e 0d 23 69 6e 63 |oolUtils|.h>.#inc|
|00000130| 6c 75 64 65 20 3c 4d 65 | 6e 75 73 2e 68 3e 0d 23 |lude <Me|nus.h>.#|
|00000140| 69 6e 63 6c 75 64 65 20 | 3c 50 61 63 6b 61 67 65 |include |<Package|
|00000150| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 54 |s.h>.#in|clude <T|
|00000160| 72 61 70 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |raps.h>.|#include|
|00000170| 20 3c 46 69 6c 65 73 2e | 68 3e 0d 23 69 6e 63 6c | <Files.|h>.#incl|
|00000180| 75 64 65 20 3c 41 6c 69 | 61 73 65 73 2e 68 3e 0d |ude <Ali|ases.h>.|
|00000190| 23 69 6e 63 6c 75 64 65 | 20 3c 41 70 70 6c 65 45 |#include| <AppleE|
|000001a0| 76 65 6e 74 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |vents.h>|.#includ|
|000001b0| 65 20 3c 47 65 73 74 61 | 6c 74 45 71 75 2e 68 3e |e <Gesta|ltEqu.h>|
|000001c0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 50 72 6f 63 65 |.#includ|e <Proce|
|000001d0| 73 73 65 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |sses.h>.|#include|
|000001e0| 20 3c 46 6f 6e 74 73 2e | 68 3e 0d 23 69 6e 63 6c | <Fonts.|h>.#incl|
|000001f0| 75 64 65 20 3c 4f 53 45 | 76 65 6e 74 73 2e 68 3e |ude <OSE|vents.h>|
|00000200| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 52 65 73 6f 75 |.#includ|e <Resou|
|00000210| 72 63 65 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |rces.h>.|#include|
|00000220| 20 3c 44 65 73 6b 2e 68 | 3e 0d 0d 23 69 6e 63 6c | <Desk.h|>..#incl|
|00000230| 75 64 65 20 3c 57 69 6e | 64 6f 77 73 2e 68 3e 0d |ude <Win|dows.h>.|
|00000240| 23 69 6e 63 6c 75 64 65 | 20 3c 51 44 4f 66 66 73 |#include| <QDOffs|
|00000250| 63 72 65 65 6e 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |creen.h>|.#includ|
|00000260| 65 20 3c 53 65 67 4c 6f | 61 64 2e 68 3e 0d 23 69 |e <SegLo|ad.h>.#i|
|00000270| 6e 63 6c 75 64 65 20 3c | 54 65 78 74 45 64 69 74 |nclude <|TextEdit|
|00000280| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 46 6f |.h>.#inc|lude <Fo|
|00000290| 6c 64 65 72 73 2e 68 3e | 0d 0d 23 69 6e 63 6c 75 |lders.h>|..#inclu|
|000002a0| 64 65 20 3c 50 69 63 74 | 55 74 69 6c 73 2e 68 3e |de <Pict|Utils.h>|
|000002b0| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 22 67 65 73 74 |..#inclu|de "gest|
|000002c0| 61 6c 74 5f 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |alt_.h".|#include|
|000002d0| 20 22 67 77 6f 72 6c 64 | 2e 68 22 0d 0d 23 69 6e | "gworld|.h"..#in|
|000002e0| 63 6c 75 64 65 20 22 66 | 73 73 70 65 63 2e 68 22 |clude "f|sspec.h"|
|000002f0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 61 63 63 65 73 |.#includ|e "acces|
|00000300| 73 5f 70 61 74 68 2e 68 | 22 0d 23 69 6e 63 6c 75 |s_path.h|".#inclu|
|00000310| 64 65 20 22 73 74 61 6e | 64 61 72 64 66 69 6c 65 |de "stan|dardfile|
|00000320| 5f 2e 68 22 0d 23 69 6e | 63 6c 75 64 65 20 22 73 |_.h".#in|clude "s|
|00000330| 74 61 6e 64 61 72 64 67 | 65 74 66 69 6c 65 2e 68 |tandardg|etfile.h|
|00000340| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 62 6f 78 6d |".#inclu|de "boxm|
|00000350| 61 6b 65 72 67 65 74 66 | 69 6c 65 2e 68 22 0d 0d |akergetf|ile.h"..|
|00000360| 23 69 6e 63 6c 75 64 65 | 20 22 68 61 6e 64 6c 65 |#include| "handle|
|00000370| 2e 68 22 0d 23 69 6e 63 | 6c 75 64 65 20 22 72 65 |.h".#inc|lude "re|
|00000380| 73 6f 75 72 63 65 2e 68 | 22 0d 0d 23 69 6e 63 6c |source.h|"..#incl|
|00000390| 75 64 65 20 22 70 69 63 | 74 75 72 65 2e 68 22 0d |ude "pic|ture.h".|
|000003a0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 72 65 73 6f 75 |.#includ|e "resou|
|000003b0| 72 63 65 66 69 6c 65 2e | 68 22 0d 0d 23 69 6e 63 |rcefile.|h"..#inc|
|000003c0| 6c 75 64 65 20 22 62 6f | 78 6d 61 6b 65 72 20 63 |lude "bo|xmaker c|
|000003d0| 6f 6e 73 74 61 6e 74 73 | 2e 68 22 0d 23 69 6e 63 |onstants|.h".#inc|
|000003e0| 6c 75 64 65 20 22 62 6f | 78 6d 61 6b 65 72 2e 68 |lude "bo|xmaker.h|
|000003f0| 22 0d 0d 23 69 6e 63 6c | 75 64 65 20 22 70 72 65 |"..#incl|ude "pre|
|00000400| 66 65 72 65 6e 63 65 73 | 2e 63 70 22 0d 23 69 6e |ferences|.cp".#in|
|00000410| 63 6c 75 64 65 20 22 70 | 69 78 65 6c 69 7a 65 2e |clude "p|ixelize.|
|00000420| 68 22 0d 0d 23 70 72 61 | 67 6d 61 20 74 65 6d 70 |h"..#pra|gma temp|
|00000430| 6c 61 74 65 5f 61 63 63 | 65 73 73 20 70 75 62 6c |late_acc|ess publ|
|00000440| 69 63 0d 0d 76 6f 69 64 | 20 6d 61 69 6e 28 29 3b |ic..void| main();|
|00000450| 0d 0d 63 6f 6e 73 74 20 | 73 68 6f 72 74 20 72 65 |..const |short re|
|00000460| 61 6c 5f 6d 6f 64 65 73 | 5b 20 31 36 5d 20 3d 0d |al_modes|[ 16] =.|
|00000470| 7b 0d 09 73 72 63 43 6f | 70 79 2c 09 09 73 72 63 |{..srcCo|py,..src|
|00000480| 4f 72 2c 09 09 09 73 72 | 63 58 6f 72 2c 09 09 09 |Or,...sr|cXor,...|
|00000490| 73 72 63 42 69 63 2c 0d | 09 6e 6f 74 53 72 63 43 |srcBic,.|.notSrcC|
|000004a0| 6f 70 79 2c 09 09 6e 6f | 74 53 72 63 4f 72 2c 09 |opy,..no|tSrcOr,.|
|000004b0| 09 6e 6f 74 53 72 63 58 | 6f 72 2c 09 09 6e 6f 74 |.notSrcX|or,..not|
|000004c0| 53 72 63 42 69 63 2c 0d | 09 62 6c 65 6e 64 2c 09 |SrcBic,.|.blend,.|
|000004d0| 09 09 61 64 64 50 69 6e | 2c 09 09 09 61 64 64 4f |..addPin|,...addO|
|000004e0| 76 65 72 2c 09 09 73 75 | 62 50 69 6e 2c 0d 09 61 |ver,..su|bPin,..a|
|000004f0| 64 64 4d 61 78 2c 09 09 | 09 61 64 4d 61 78 2c 09 |ddMax,..|.adMax,.|
|00000500| 09 09 73 75 62 4f 76 65 | 72 2c 09 09 61 64 4d 69 |..subOve|r,..adMi|
|00000510| 6e 0d 7d 3b 0d 0d 76 6f | 69 64 20 6d 61 69 6e 28 |n.};..vo|id main(|
|00000520| 29 0d 7b 0d 09 70 69 78 | 65 6c 69 7a 65 5f 73 65 |).{..pix|elize_se|
|00000530| 74 74 69 6e 67 73 20 64 | 65 66 61 75 6c 74 73 65 |ttings d|efaultse|
|00000540| 74 74 69 6e 67 73 20 3d | 0d 09 7b 0d 09 09 69 42 |ttings =|..{...iB|
|00000550| 6c 61 63 6b 41 6e 64 57 | 68 69 74 65 2c 0d 09 09 |lackAndW|hite,...|
|00000560| 69 50 69 63 74 46 69 6c | 65 2c 0d 09 09 75 73 65 |iPictFil|e,...use|
|00000570| 53 79 73 74 65 6d 44 65 | 66 61 75 6c 74 2c 0d 09 |SystemDe|fault,..|
|00000580| 09 66 61 6c 73 65 2c 09 | 09 09 09 2f 2f 20 64 6f |.false,.|...// do|
|00000590| 6e 74 43 6f 75 6e 74 50 | 69 78 65 6c 73 0d 09 09 |ntCountP|ixels...|
|000005a0| 66 61 6c 73 65 2c 09 09 | 09 09 2f 2f 20 64 6f 6e |false,..|..// don|
|000005b0| 74 20 73 75 70 70 72 65 | 73 73 20 42 6c 61 63 6b |t suppre|ss Black|
|000005c0| 20 61 6e 64 20 57 68 69 | 74 65 0d 09 09 66 61 6c | and Whi|te...fal|
|000005d0| 73 65 2c 09 09 09 09 2f | 2f 20 6e 6f 74 20 74 72 |se,..../|/ not tr|
|000005e0| 61 6e 73 70 61 72 65 6e | 74 0d 09 09 74 72 75 65 |ansparen|t...true|
|000005f0| 2c 09 09 09 09 2f 2f 20 | 64 6f 20 64 69 74 68 65 |,....// |do dithe|
|00000600| 72 0d 09 09 30 09 09 09 | 09 09 2f 2f 20 73 72 63 |r...0...|..// src|
|00000610| 43 6f 70 79 0d 09 7d 3b | 0d 09 73 74 72 69 6e 67 |Copy..};|..string|
|00000620| 68 61 6e 64 6c 65 20 70 | 72 65 66 73 46 69 6c 65 |handle p|refsFile|
|00000630| 48 61 6e 64 6c 65 28 20 | 31 32 38 29 3b 0d 0d 09 |Handle( |128);...|
|00000640| 70 69 78 65 6c 69 7a 65 | 5f 73 68 65 6c 6c 20 69 |pixelize|_shell i|
|00000650| 74 28 20 2a 28 53 74 72 | 36 33 20 2a 29 2a 28 48 |t( *(Str|63 *)*(H|
|00000660| 61 6e 64 6c 65 29 70 72 | 65 66 73 46 69 6c 65 48 |andle)pr|efsFileH|
|00000670| 61 6e 64 6c 65 2c 20 64 | 65 66 61 75 6c 74 73 65 |andle, d|efaultse|
|00000680| 74 74 69 6e 67 73 29 3b | 0d 09 69 74 2e 72 75 6e |ttings);|..it.run|
|00000690| 28 29 3b 0d 7d 0d 0d 70 | 69 78 65 6c 69 7a 65 5f |();.}..p|ixelize_|
|000006a0| 73 68 65 6c 6c 3a 3a 70 | 69 78 65 6c 69 7a 65 5f |shell::p|ixelize_|
|000006b0| 73 68 65 6c 6c 28 0d 09 | 53 74 72 33 31 20 70 72 |shell(..|Str31 pr|
|000006c0| 65 66 73 46 69 6c 65 4e | 61 6d 65 2c 20 70 69 78 |efsFileN|ame, pix|
|000006d0| 65 6c 69 7a 65 5f 73 65 | 74 74 69 6e 67 73 20 26 |elize_se|ttings &|
|000006e0| 64 65 66 61 75 6c 74 73 | 65 74 74 69 6e 67 73 29 |defaults|ettings)|
|000006f0| 0d 09 3a 20 62 6f 78 6d | 61 6b 65 72 28 20 33 30 |..: boxm|aker( 30|
|00000700| 30 30 29 0d 09 2c 20 70 | 69 78 65 6c 69 7a 65 5f |00).., p|ixelize_|
|00000710| 70 72 65 66 73 28 20 70 | 72 65 66 73 46 69 6c 65 |prefs( p|refsFile|
|00000720| 4e 61 6d 65 2c 20 64 65 | 66 61 75 6c 74 73 65 74 |Name, de|faultset|
|00000730| 74 69 6e 67 73 29 0d 7b | 0d 09 66 6f 6c 64 65 72 |tings).{|..folder|
|00000740| 5f 64 65 70 74 68 20 3d | 20 30 3b 0d 0d 09 43 68 |_depth =| 0;...Ch|
|00000750| 61 6e 67 65 44 65 70 74 | 68 28 20 77 68 69 63 68 |angeDept|h( which|
|00000760| 44 65 70 74 68 29 3b 0d | 09 43 68 61 6e 67 65 53 |Depth);.|.ChangeS|
|00000770| 74 6f 72 61 67 65 28 20 | 77 68 69 63 68 53 74 6f |torage( |whichSto|
|00000780| 72 61 67 65 29 3b 0d 09 | 43 68 61 6e 67 65 53 61 |rage);..|ChangeSa|
|00000790| 6d 70 6c 69 6e 67 28 20 | 77 68 69 63 68 53 61 6d |mpling( |whichSam|
|000007a0| 70 6c 69 6e 67 29 3b 0d | 09 43 68 61 6e 67 65 4d |pling);.|.ChangeM|
|000007b0| 6f 64 65 28 20 77 68 69 | 63 68 54 72 61 6e 73 66 |ode( whi|chTransf|
|000007c0| 65 72 6d 6f 64 65 29 3b | 0d 0d 09 53 65 74 41 42 |ermode);|...SetAB|
|000007d0| 75 74 74 6f 6e 28 20 69 | 43 6f 75 6e 74 50 69 78 |utton( i|CountPix|
|000007e0| 65 6c 73 2c 20 63 6f 75 | 6e 74 50 69 78 65 6c 73 |els, cou|ntPixels|
|000007f0| 29 3b 0d 09 53 65 74 41 | 42 75 74 74 6f 6e 28 20 |);..SetA|Button( |
|00000800| 69 41 6c 77 61 79 73 41 | 64 64 42 57 2c 20 61 6c |iAlwaysA|ddBW, al|
|00000810| 77 61 79 73 41 64 64 42 | 57 29 3b 0d 09 53 65 74 |waysAddB|W);..Set|
|00000820| 41 42 75 74 74 6f 6e 28 | 20 69 54 72 61 6e 73 70 |AButton(| iTransp|
|00000830| 61 72 65 6e 74 2c 20 6d | 61 6b 65 54 72 61 6e 73 |arent, m|akeTrans|
|00000840| 70 61 72 65 6e 74 29 3b | 0d 09 53 65 74 41 42 75 |parent);|..SetABu|
|00000850| 74 74 6f 6e 28 20 69 44 | 69 74 68 65 72 2c 20 64 |tton( iD|ither, d|
|00000860| 69 74 68 65 72 29 3b 0d | 7d 0d 0d 76 6f 69 64 20 |ither);.|}..void |
|00000870| 70 69 78 65 6c 69 7a 65 | 5f 73 68 65 6c 6c 3a 3a |pixelize|_shell::|
|00000880| 4f 70 65 6e 44 6f 63 28 | 20 42 6f 6f 6c 65 61 6e |OpenDoc(| Boolean|
|00000890| 20 6f 70 65 6e 69 6e 67 | 29 0d 7b 0d 2f 2f 0d 2f | opening|).{.//./|
|000008a0| 2f 20 57 41 52 4e 49 4e | 47 3a 20 55 67 6c 79 20 |/ WARNIN|G: Ugly |
|000008b0| 6c 6f 6e 67 20 66 75 6e | 63 74 69 6f 6e 20 61 68 |long fun|ction ah|
|000008c0| 65 61 64 21 0d 2f 2f 0d | 09 63 6f 6e 73 74 20 4f |ead!.//.|.const O|
|000008d0| 53 54 79 70 65 20 74 68 | 65 54 79 70 65 20 3d 20 |SType th|eType = |
|000008e0| 74 68 65 43 49 6e 66 6f | 50 42 52 65 63 2e 68 46 |theCInfo|PBRec.hF|
|000008f0| 69 6c 65 49 6e 66 6f 2e | 69 6f 46 6c 46 6e 64 72 |ileInfo.|ioFlFndr|
|00000900| 49 6e 66 6f 2e 66 64 54 | 79 70 65 3b 0d 2f 2f 0d |Info.fdT|ype;.//.|
|00000910| 2f 2f 20 72 65 61 64 20 | 69 6e 20 74 68 65 20 50 |// read |in the P|
|00000920| 49 43 54 3a 0d 2f 2f 0d | 09 50 69 63 48 61 6e 64 |ICT:.//.|.PicHand|
|00000930| 6c 65 20 74 68 65 50 49 | 43 54 20 3d 20 30 3b 0d |le thePI|CT = 0;.|
|00000940| 0d 09 73 77 69 74 63 68 | 28 20 74 68 65 54 79 70 |..switch|( theTyp|
|00000950| 65 29 0d 09 7b 0d 09 09 | 63 61 73 65 20 27 50 49 |e)..{...|case 'PI|
|00000960| 43 54 27 3a 0d 09 09 09 | 74 68 65 50 49 43 54 20 |CT':....|thePICT |
|00000970| 3d 20 52 65 61 64 50 69 | 63 74 46 69 6c 65 28 20 |= ReadPi|ctFile( |
|00000980| 74 68 65 66 73 73 70 65 | 63 29 3b 0d 09 09 09 62 |thefsspe|c);....b|
|00000990| 72 65 61 6b 3b 0d 0d 09 | 09 63 61 73 65 20 27 70 |reak;...|.case 'p|
|000009a0| 67 6d 35 27 3a 0d 09 09 | 63 61 73 65 20 27 50 47 |gm5':...|case 'PG|
|000009b0| 4d 35 27 3a 0d 09 09 09 | 74 68 65 50 49 43 54 20 |M5':....|thePICT |
|000009c0| 3d 20 52 65 61 64 5f 70 | 67 6d 5f 66 69 6c 65 28 |= Read_p|gm_file(|
|000009d0| 20 74 68 65 66 73 73 70 | 65 63 29 3b 0d 09 09 09 | thefssp|ec);....|
|000009e0| 62 72 65 61 6b 3b 0d 0d | 09 09 64 65 66 61 75 6c |break;..|..defaul|
|000009f0| 74 3a 0d 09 09 09 74 68 | 65 50 49 43 54 20 3d 20 |t:....th|ePICT = |
|00000a00| 52 65 61 64 50 69 63 74 | 52 65 73 6f 75 72 63 65 |ReadPict|Resource|
|00000a10| 28 20 74 68 65 66 73 73 | 70 65 63 29 3b 0d 09 7d |( thefss|pec);..}|
|00000a20| 0d 09 69 66 28 20 74 68 | 65 50 49 43 54 20 3d 3d |..if( th|ePICT ==|
|00000a30| 20 30 29 0d 09 7b 0d 09 | 09 53 79 73 42 65 65 70 | 0)..{..|.SysBeep|
|00000a40| 28 20 39 29 3b 0d 09 7d | 20 65 6c 73 65 20 7b 0d |( 9);..}| else {.|
|00000a50| 09 09 52 65 63 74 20 50 | 49 43 54 52 65 63 74 20 |..Rect P|ICTRect |
|00000a60| 3d 20 28 2a 2a 74 68 65 | 50 49 43 54 29 2e 70 69 |= (**the|PICT).pi|
|00000a70| 63 46 72 61 6d 65 3b 0d | 09 09 4f 66 66 73 65 74 |cFrame;.|..Offset|
|00000a80| 52 65 63 74 28 20 26 50 | 49 43 54 52 65 63 74 2c |Rect( &P|ICTRect,|
|00000a90| 20 2d 50 49 43 54 52 65 | 63 74 2e 6c 65 66 74 2c | -PICTRe|ct.left,|
|00000aa0| 20 2d 50 49 43 54 52 65 | 63 74 2e 74 6f 70 29 3b | -PICTRe|ct.top);|
|00000ab0| 0d 09 09 63 6f 6e 73 74 | 20 73 68 6f 72 74 20 50 |...const| short P|
|00000ac0| 49 43 54 57 69 64 74 68 | 20 20 3d 20 50 49 43 54 |ICTWidth| = PICT|
|00000ad0| 52 65 63 74 2e 72 69 67 | 68 74 3b 0d 09 09 63 6f |Rect.rig|ht;...co|
|00000ae0| 6e 73 74 20 73 68 6f 72 | 74 20 50 49 43 54 68 65 |nst shor|t PICThe|
|00000af0| 69 67 68 74 20 3d 20 50 | 49 43 54 52 65 63 74 2e |ight = P|ICTRect.|
|00000b00| 62 6f 74 74 6f 6d 3b 0d | 2f 2f 0d 2f 2f 20 4f 62 |bottom;.|//.// Ob|
|00000b10| 74 61 69 6e 20 61 20 63 | 6f 6c 6f 72 20 74 61 62 |tain a c|olor tab|
|00000b20| 6c 65 20 66 6f 72 20 74 | 68 65 20 72 65 73 75 6c |le for t|he resul|
|00000b30| 74 69 6e 67 20 50 49 43 | 54 3a 0d 2f 2f 0d 09 09 |ting PIC|T:.//...|
|00000b40| 43 54 61 62 48 61 6e 64 | 6c 65 20 74 68 65 4e 65 |CTabHand|le theNe|
|00000b50| 77 43 6f 6c 6f 72 54 61 | 62 6c 65 20 3d 20 30 4c |wColorTa|ble = 0L|
|00000b60| 3b 0d 0d 09 09 63 6f 6e | 73 74 20 69 6e 74 20 72 |;....con|st int r|
|00000b70| 65 71 75 65 73 74 65 64 | 44 65 70 74 68 20 3d 20 |equested|Depth = |
|00000b80| 28 31 20 3c 3c 20 28 77 | 68 69 63 68 44 65 70 74 |(1 << (w|hichDept|
|00000b90| 68 20 2d 20 31 29 29 3b | 0d 0d 09 09 69 66 28 20 |h - 1));|....if( |
|00000ba0| 72 65 71 75 65 73 74 65 | 64 44 65 70 74 68 20 3d |requeste|dDepth =|
|00000bb0| 3d 20 31 29 0d 09 09 7b | 0d 09 09 09 74 68 65 4e |= 1)...{|....theN|
|00000bc0| 65 77 43 6f 6c 6f 72 54 | 61 62 6c 65 20 3d 20 28 |ewColorT|able = (|
|00000bd0| 43 54 61 62 48 61 6e 64 | 6c 65 29 47 65 74 52 65 |CTabHand|le)GetRe|
|00000be0| 73 6f 75 72 63 65 28 20 | 27 63 6c 75 74 27 2c 20 |source( |'clut', |
|00000bf0| 31 29 3b 0d 09 09 09 44 | 65 74 61 63 68 52 65 73 |1);....D|etachRes|
|00000c00| 6f 75 72 63 65 28 20 28 | 48 61 6e 64 6c 65 29 74 |ource( (|Handle)t|
|00000c10| 68 65 4e 65 77 43 6f 6c | 6f 72 54 61 62 6c 65 29 |heNewCol|orTable)|
|00000c20| 3b 0d 09 09 7d 20 65 6c | 73 65 20 7b 0d 09 09 09 |;...} el|se {....|
|00000c30| 73 77 69 74 63 68 28 20 | 77 68 69 63 68 53 61 6d |switch( |whichSam|
|00000c40| 70 6c 69 6e 67 29 0d 09 | 09 09 7b 0d 09 09 09 09 |pling)..|..{.....|
|00000c50| 63 61 73 65 20 75 73 65 | 53 79 73 74 65 6d 44 65 |case use|SystemDe|
|00000c60| 66 61 75 6c 74 3a 0d 09 | 09 09 09 09 2f 2f 0d 09 |fault:..|....//..|
|00000c70| 09 09 09 09 2f 2f 20 64 | 6f 20 77 65 20 6e 65 65 |....// d|o we nee|
|00000c80| 64 20 74 68 69 73 20 6f | 72 20 77 69 6c 6c 20 74 |d this o|r will t|
|00000c90| 68 65 20 67 77 6f 72 6c | 64 20 67 65 74 20 74 68 |he gworl|d get th|
|00000ca0| 69 73 20 6f 6e 65 2c 20 | 61 6e 79 77 61 79 3f 0d |is one, |anyway?.|
|00000cb0| 09 09 09 09 09 2f 2f 0d | 09 09 09 09 09 74 68 65 |.....//.|.....the|
|00000cc0| 4e 65 77 43 6f 6c 6f 72 | 54 61 62 6c 65 20 3d 20 |NewColor|Table = |
|00000cd0| 28 43 54 61 62 48 61 6e | 64 6c 65 29 47 65 74 52 |(CTabHan|dle)GetR|
|00000ce0| 65 73 6f 75 72 63 65 28 | 20 27 63 6c 75 74 27 2c |esource(| 'clut',|
|00000cf0| 20 72 65 71 75 65 73 74 | 65 64 44 65 70 74 68 29 | request|edDepth)|
|00000d00| 3b 0d 09 09 09 09 09 44 | 65 74 61 63 68 52 65 73 |;......D|etachRes|
|00000d10| 6f 75 72 63 65 28 20 28 | 48 61 6e 64 6c 65 29 74 |ource( (|Handle)t|
|00000d20| 68 65 4e 65 77 43 6f 6c | 6f 72 54 61 62 6c 65 29 |heNewCol|orTable)|
|00000d30| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 0d 09 |;......b|reak;...|
|00000d40| 09 09 09 64 65 66 61 75 | 6c 74 3a 0d 09 09 09 09 |...defau|lt:.....|
|00000d50| 09 2f 2f 0d 09 09 09 09 | 09 2f 2f 20 42 55 47 20 |.//.....|.// BUG |
|00000d60| 41 4c 45 52 54 21 20 42 | 55 47 20 41 4c 45 52 54 |ALERT! B|UG ALERT|
|00000d70| 21 20 42 55 47 20 41 4c | 45 52 54 21 20 42 55 47 |! BUG AL|ERT! BUG|
|00000d80| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00000d90| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 20 42 55 |T! BUG A|LERT! BU|
|00000da0| 47 20 41 4c 45 52 54 21 | 0d 09 09 09 09 09 2f 2f |G ALERT!|......//|
|00000db0| 20 42 55 47 20 41 4c 45 | 52 54 21 20 42 55 47 20 | BUG ALE|RT! BUG |
|00000dc0| 41 4c 45 52 54 21 20 42 | 55 47 20 41 4c 45 52 54 |ALERT! B|UG ALERT|
|00000dd0| 21 20 42 55 47 20 41 4c | 45 52 54 21 20 42 55 47 |! BUG AL|ERT! BUG|
|00000de0| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00000df0| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 0d 09 09 |T! BUG A|LERT!...|
|00000e00| 09 09 09 2f 2f 20 42 55 | 47 20 41 4c 45 52 54 21 |...// BU|G ALERT!|
|00000e10| 20 42 55 47 20 41 4c 45 | 52 54 21 20 42 55 47 20 | BUG ALE|RT! BUG |
|00000e20| 41 4c 45 52 54 21 20 42 | 55 47 20 41 4c 45 52 54 |ALERT! B|UG ALERT|
|00000e30| 21 20 42 55 47 20 41 4c | 45 52 54 21 20 42 55 47 |! BUG AL|ERT! BUG|
|00000e40| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00000e50| 54 21 0d 09 09 09 09 09 | 2f 2f 0d 09 09 09 09 09 |T!......|//......|
|00000e60| 2f 2f 09 09 75 73 65 72 | 2d 73 70 65 63 69 66 69 |//..user|-specifi|
|00000e70| 65 64 20 73 65 6c 65 63 | 74 69 6f 6e 20 69 6e 20 |ed selec|tion in |
|00000e80| 61 20 72 65 73 6f 75 72 | 63 65 2e 20 46 6f 72 20 |a resour|ce. For |
|00000e90| 6e 6f 77 2c 20 77 65 20 | 61 73 73 75 6d 65 20 74 |now, we |assume t|
|00000ea0| 68 61 74 0d 09 09 09 09 | 09 2f 2f 09 09 75 73 65 |hat.....|.//..use|
|00000eb0| 72 2d 73 70 65 63 69 66 | 69 65 64 20 72 65 73 6f |r-specif|ied reso|
|00000ec0| 75 72 63 65 73 20 61 72 | 65 20 6e 75 6d 62 65 72 |urces ar|e number|
|00000ed0| 65 64 20 63 6f 6e 73 65 | 63 75 74 69 76 65 20 77 |ed conse|cutive w|
|00000ee0| 69 74 68 20 74 68 65 0d | 09 09 09 09 09 2f 2f 09 |ith the.|.....//.|
|00000ef0| 09 73 79 73 74 65 6d 20 | 6f 6e 65 73 2e 20 54 48 |.system |ones. TH|
|00000f00| 49 53 20 49 53 20 41 20 | 42 55 47 2c 20 73 69 6e |IS IS A |BUG, sin|
|00000f10| 63 65 20 6e 6f 74 68 69 | 6e 67 20 69 73 20 6b 6e |ce nothi|ng is kn|
|00000f20| 6f 77 6e 20 61 62 6f 75 | 74 20 74 68 65 20 6f 72 |own abou|t the or|
|00000f30| 64 65 72 0d 09 09 09 09 | 09 2f 2f 09 09 69 6e 20 |der.....|.//..in |
|00000f40| 77 68 69 63 68 20 74 68 | 65 20 69 74 65 6d 73 20 |which th|e items |
|00000f50| 61 72 65 20 61 64 64 65 | 64 20 74 6f 20 74 68 65 |are adde|d to the|
|00000f60| 20 70 6f 70 2d 75 70 20 | 6d 65 6e 75 2e 20 49 20 | pop-up |menu. I |
|00000f70| 72 65 70 65 61 74 3a 0d | 09 09 09 09 09 2f 2f 0d |repeat:.|.....//.|
|00000f80| 09 09 09 09 09 2f 2f 20 | 42 55 47 20 41 4c 45 52 |.....// |BUG ALER|
|00000f90| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 20 42 55 |T! BUG A|LERT! BU|
|00000fa0| 47 20 41 4c 45 52 54 21 | 20 42 55 47 20 41 4c 45 |G ALERT!| BUG ALE|
|00000fb0| 52 54 21 20 42 55 47 20 | 41 4c 45 52 54 21 20 42 |RT! BUG |ALERT! B|
|00000fc0| 55 47 20 41 4c 45 52 54 | 21 20 42 55 47 20 41 4c |UG ALERT|! BUG AL|
|00000fd0| 45 52 54 21 0d 09 09 09 | 09 09 2f 2f 20 42 55 47 |ERT!....|..// BUG|
|00000fe0| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00000ff0| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 20 42 55 |T! BUG A|LERT! BU|
|00001000| 47 20 41 4c 45 52 54 21 | 20 42 55 47 20 41 4c 45 |G ALERT!| BUG ALE|
|00001010| 52 54 21 20 42 55 47 20 | 41 4c 45 52 54 21 20 42 |RT! BUG |ALERT! B|
|00001020| 55 47 20 41 4c 45 52 54 | 21 0d 09 09 09 09 09 2f |UG ALERT|!....../|
|00001030| 2f 20 42 55 47 20 41 4c | 45 52 54 21 20 42 55 47 |/ BUG AL|ERT! BUG|
|00001040| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00001050| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 20 42 55 |T! BUG A|LERT! BU|
|00001060| 47 20 41 4c 45 52 54 21 | 20 42 55 47 20 41 4c 45 |G ALERT!| BUG ALE|
|00001070| 52 54 21 20 42 55 47 20 | 41 4c 45 52 54 21 0d 09 |RT! BUG |ALERT!..|
|00001080| 09 09 09 09 2f 2f 0d 09 | 09 09 09 63 61 73 65 20 |....//..|...case |
|00001090| 75 73 65 53 79 73 74 65 | 6d 4d 65 74 68 6f 64 3a |useSyste|mMethod:|
|000010a0| 0d 09 09 09 09 63 61 73 | 65 20 75 73 65 50 6f 70 |.....cas|e usePop|
|000010b0| 75 6c 61 72 4d 65 74 68 | 6f 64 3a 0d 09 09 09 09 |ularMeth|od:.....|
|000010c0| 63 61 73 65 20 75 73 65 | 4d 65 64 69 61 6e 4d 65 |case use|MedianMe|
|000010d0| 74 68 6f 64 3a 0d 09 09 | 09 09 09 63 6f 6e 73 74 |thod:...|...const|
|000010e0| 20 69 6e 74 20 72 65 61 | 6c 5f 6d 65 74 68 6f 64 | int rea|l_method|
|000010f0| 20 3d 20 73 79 73 74 65 | 6d 4d 65 74 68 6f 64 20 | = syste|mMethod |
|00001100| 2b 20 28 77 68 69 63 68 | 53 61 6d 70 6c 69 6e 67 |+ (which|Sampling|
|00001110| 20 2d 20 75 73 65 53 79 | 73 74 65 6d 4d 65 74 68 | - useSy|stemMeth|
|00001120| 6f 64 29 3b 0d 0d 09 09 | 09 09 09 63 6f 6e 73 74 |od);....|...const|
|00001130| 20 69 6e 74 20 72 65 71 | 75 65 73 74 65 64 43 6f | int req|uestedCo|
|00001140| 6c 6f 72 73 20 3d 20 28 | 31 20 3c 3c 20 72 65 71 |lors = (|1 << req|
|00001150| 75 65 73 74 65 64 44 65 | 70 74 68 29 0d 09 09 09 |uestedDe|pth)....|
|00001160| 09 09 09 09 2d 20 28 32 | 20 2a 20 61 6c 77 61 79 |....- (2| * alway|
|00001170| 73 41 64 64 42 57 29 3b | 09 09 09 09 09 09 09 2f |sAddBW);|......./|
|00001180| 2f 20 66 6f 72 20 62 6c | 61 63 6b 20 61 6e 64 20 |/ for bl|ack and |
|00001190| 77 68 69 74 65 0d 09 09 | 09 09 09 2f 2f 0d 09 09 |white...|...//...|
|000011a0| 09 09 09 2f 2f 20 63 6f | 6e 76 65 72 74 20 74 68 |...// co|nvert th|
|000011b0| 65 20 70 69 63 74 75 72 | 65 20 74 6f 20 61 20 70 |e pictur|e to a p|
|000011c0| 69 78 6d 61 70 2c 20 69 | 66 20 27 63 6f 75 6e 74 |ixmap, i|f 'count|
|000011d0| 50 69 78 65 6c 73 27 20 | 69 73 20 73 65 74 2e 0d |Pixels' |is set..|
|000011e0| 09 09 09 09 09 2f 2f 20 | 54 68 69 73 20 6d 61 6b |.....// |This mak|
|000011f0| 65 73 20 74 68 61 74 20 | 74 68 65 20 27 47 65 74 |es that |the 'Get|
|00001200| 50 69 63 74 49 6e 66 6f | 27 20 63 61 6c 6c 20 77 |PictInfo|' call w|
|00001210| 69 6c 6c 20 64 6f 20 61 | 20 27 47 65 74 50 69 78 |ill do a| 'GetPix|
|00001220| 4d 61 70 49 6e 66 6f 27 | 20 69 6e 73 74 65 61 64 |MapInfo'| instead|
|00001230| 2e 0d 09 09 09 09 09 2f | 2f 20 54 68 65 20 64 65 |......./|/ The de|
|00001240| 66 61 75 6c 74 20 64 65 | 70 74 68 20 66 6f 72 20 |fault de|pth for |
|00001250| 74 68 65 20 50 69 78 4d | 61 70 20 69 73 20 33 32 |the PixM|ap is 32|
|00001260| 2e 20 54 68 69 73 20 65 | 61 74 73 20 61 20 6c 6f |. This e|ats a lo|
|00001270| 74 20 6f 66 20 6d 65 6d | 6f 72 79 2c 20 62 75 74 |t of mem|ory, but|
|00001280| 0d 09 09 09 09 09 2f 2f | 20 65 6e 73 75 72 65 73 |......//| ensures|
|00001290| 20 61 20 6c 6f 73 73 2d | 66 72 65 65 20 63 6f 6e | a loss-|free con|
|000012a0| 76 65 72 73 69 6f 6e 2e | 0d 09 09 09 09 09 2f 2f |version.|......//|
|000012b0| 0d 09 09 09 09 09 69 66 | 28 20 63 6f 75 6e 74 50 |......if|( countP|
|000012c0| 69 78 65 6c 73 29 0d 09 | 09 09 09 09 7b 0d 09 09 |ixels)..|....{...|
|000012d0| 09 09 09 09 50 69 63 48 | 61 6e 64 6c 65 20 74 65 |....PicH|andle te|
|000012e0| 6d 70 20 3d 20 74 68 65 | 50 49 43 54 3b 0d 09 09 |mp = the|PICT;...|
|000012f0| 09 09 09 09 74 68 65 50 | 49 43 54 20 3d 20 63 6f |....theP|ICT = co|
|00001300| 6e 76 65 72 74 54 6f 50 | 69 78 4d 61 70 28 20 74 |nvertToP|ixMap( t|
|00001310| 65 6d 70 29 3b 0d 09 09 | 09 09 09 09 4b 69 6c 6c |emp);...|....Kill|
|00001320| 50 69 63 74 75 72 65 28 | 20 74 65 6d 70 29 3b 0d |Picture(| temp);.|
|00001330| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 2f 2f 0d 09 |.....}..|....//..|
|00001340| 09 09 09 09 2f 2f 20 4f | 62 74 61 69 6e 20 63 6f |....// O|btain co|
|00001350| 6c 6f 72 20 74 61 62 6c | 65 20 3d 20 43 6f 6c 6f |lor tabl|e = Colo|
|00001360| 72 20 6d 61 74 63 68 69 | 6e 67 20 72 65 71 75 65 |r matchi|ng reque|
|00001370| 73 74 65 64 20 3d 3e 20 | 47 65 74 50 69 63 74 49 |sted => |GetPictI|
|00001380| 6e 66 6f 2c 0d 09 09 09 | 09 09 2f 2f 20 65 6c 73 |nfo,....|..// els|
|00001390| 65 20 67 65 74 20 63 6f | 6c 6f 72 20 74 61 62 6c |e get co|lor tabl|
|000013a0| 65 20 66 72 6f 6d 20 73 | 79 73 74 65 6d 2e 0d 09 |e from s|ystem...|
|000013b0| 09 09 09 09 2f 2f 0d 09 | 09 09 09 09 2f 2f 20 4f |....//..|....// O|
|000013c0| 62 74 61 69 6e 20 70 69 | 63 74 75 72 65 20 69 6e |btain pi|cture in|
|000013d0| 66 6f 3a 0d 09 09 09 09 | 09 2f 2f 0d 09 09 09 09 |fo:.....|.//.....|
|000013e0| 09 63 6f 6e 73 74 20 73 | 68 6f 72 74 20 76 65 72 |.const s|hort ver|
|000013f0| 73 69 6f 6e 20 3d 20 30 | 3b 0d 0d 09 09 09 09 09 |sion = 0|;.......|
|00001400| 50 69 63 74 49 6e 66 6f | 20 74 68 65 50 69 63 74 |PictInfo| thePict|
|00001410| 49 6e 66 6f 3b 0d 0d 09 | 09 09 09 09 73 74 61 74 |Info;...|....stat|
|00001420| 69 63 20 63 6f 6e 73 74 | 20 69 6e 74 20 74 68 65 |ic const| int the|
|00001430| 41 73 6b 73 5b 20 32 5d | 20 3d 0d 09 09 09 09 09 |Asks[ 2]| =......|
|00001440| 7b 0d 09 09 09 09 09 09 | 72 65 74 75 72 6e 43 6f |{.......|returnCo|
|00001450| 6c 6f 72 54 61 62 6c 65 | 2c 20 72 65 74 75 72 6e |lorTable|, return|
|00001460| 50 61 6c 65 74 74 65 20 | 7c 20 73 75 70 70 72 65 |Palette || suppre|
|00001470| 73 73 42 6c 61 63 6b 41 | 6e 64 57 68 69 74 65 0d |ssBlackA|ndWhite.|
|00001480| 09 09 09 09 09 7d 3b 0d | 09 09 09 09 09 63 6f 6e |.....};.|.....con|
|00001490| 73 74 20 69 6e 74 20 74 | 6f 41 73 6b 20 3d 20 74 |st int t|oAsk = t|
|000014a0| 68 65 41 73 6b 73 5b 20 | 61 6c 77 61 79 73 41 64 |heAsks[ |alwaysAd|
|000014b0| 64 42 57 5d 3b 0d 0d 09 | 09 09 09 09 69 66 28 20 |dBW];...|....if( |
|000014c0| 47 65 74 50 69 63 74 49 | 6e 66 6f 28 20 74 68 65 |GetPictI|nfo( the|
|000014d0| 50 49 43 54 2c 20 26 74 | 68 65 50 69 63 74 49 6e |PICT, &t|hePictIn|
|000014e0| 66 6f 2c 0d 09 09 09 09 | 09 09 74 6f 41 73 6b 2c |fo,.....|..toAsk,|
|000014f0| 20 72 65 71 75 65 73 74 | 65 64 43 6f 6c 6f 72 73 | request|edColors|
|00001500| 2c 20 72 65 61 6c 5f 6d | 65 74 68 6f 64 2c 20 76 |, real_m|ethod, v|
|00001510| 65 72 73 69 6f 6e 29 20 | 3d 3d 20 6e 6f 45 72 72 |ersion) |== noErr|
|00001520| 29 0d 09 09 09 09 09 7b | 0d 09 09 09 09 09 09 2f |)......{|......./|
|00001530| 2f 0d 09 09 09 09 09 09 | 2f 2f 20 42 75 69 6c 64 |/.......|// Build|
|00001540| 20 61 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 20 77 | a color| table w|
|00001550| 69 74 68 20 62 6c 61 63 | 6b 20 61 6e 64 20 77 68 |ith blac|k and wh|
|00001560| 69 74 65 20 61 64 64 65 | 64 3a 0d 09 09 09 09 09 |ite adde|d:......|
|00001570| 09 2f 2f 0d 09 09 09 09 | 09 09 69 66 28 20 61 6c |.//.....|..if( al|
|00001580| 77 61 79 73 41 64 64 42 | 57 29 0d 09 09 09 09 09 |waysAddB|W)......|
|00001590| 09 7b 0d 09 09 09 09 09 | 09 09 74 68 65 4e 65 77 |.{......|..theNew|
|000015a0| 43 6f 6c 6f 72 54 61 62 | 6c 65 20 3d 20 41 64 64 |ColorTab|le = Add|
|000015b0| 42 6c 61 63 6b 57 68 69 | 74 65 28 20 74 68 65 50 |BlackWhi|te( theP|
|000015c0| 69 63 74 49 6e 66 6f 2e | 74 68 65 50 61 6c 65 74 |ictInfo.|thePalet|
|000015d0| 74 65 29 3b 0d 0d 09 09 | 09 09 09 09 09 44 69 73 |te);....|.....Dis|
|000015e0| 70 6f 73 65 48 61 6e 64 | 6c 65 28 20 28 48 61 6e |poseHand|le( (Han|
|000015f0| 64 6c 65 29 74 68 65 50 | 69 63 74 49 6e 66 6f 2e |dle)theP|ictInfo.|
|00001600| 74 68 65 50 61 6c 65 74 | 74 65 29 3b 0d 09 09 09 |thePalet|te);....|
|00001610| 09 09 09 7d 20 65 6c 73 | 65 20 7b 0d 09 09 09 09 |...} els|e {.....|
|00001620| 09 09 09 74 68 65 4e 65 | 77 43 6f 6c 6f 72 54 61 |...theNe|wColorTa|
|00001630| 62 6c 65 20 3d 20 74 68 | 65 50 69 63 74 49 6e 66 |ble = th|ePictInf|
|00001640| 6f 2e 74 68 65 43 6f 6c | 6f 72 54 61 62 6c 65 3b |o.theCol|orTable;|
|00001650| 0d 09 09 09 09 09 09 7d | 0d 09 09 09 09 09 7d 20 |.......}|......} |
|00001660| 65 6c 73 65 20 7b 0d 09 | 09 09 09 09 09 53 79 73 |else {..|.....Sys|
|00001670| 42 65 65 70 28 20 39 29 | 3b 0d 09 09 09 09 09 7d |Beep( 9)|;......}|
|00001680| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00001690| 7d 0d 09 09 7d 0d 09 09 | 2f 2f 0d 09 09 2f 2f 20 |}...}...|//...// |
|000016a0| 63 72 65 61 74 65 20 74 | 68 65 20 70 69 78 20 6d |create t|he pix m|
|000016b0| 61 70 20 70 69 63 74 75 | 72 65 3a 0d 09 09 2f 2f |ap pictu|re:...//|
|000016c0| 0d 09 09 73 68 6f 72 74 | 20 6d 6f 64 65 20 3d 20 |...short| mode = |
|000016d0| 72 65 61 6c 5f 6d 6f 64 | 65 73 5b 20 77 68 69 63 |real_mod|es[ whic|
|000016e0| 68 54 72 61 6e 73 66 65 | 72 6d 6f 64 65 20 2d 20 |hTransfe|rmode - |
|000016f0| 31 5d 3b 0d 09 09 69 66 | 28 20 64 69 74 68 65 72 |1];...if|( dither|
|00001700| 29 0d 09 09 7b 0d 09 09 | 09 6d 6f 64 65 20 2b 3d |)...{...|.mode +=|
|00001710| 20 64 69 74 68 65 72 43 | 6f 70 79 3b 0d 09 09 7d | ditherC|opy;...}|
|00001720| 0d 09 09 50 69 63 48 61 | 6e 64 6c 65 20 74 65 6d |...PicHa|ndle tem|
|00001730| 70 20 3d 20 74 68 65 50 | 49 43 54 3b 0d 0d 09 09 |p = theP|ICT;....|
|00001740| 74 68 65 50 49 43 54 20 | 3d 20 63 6f 6e 76 65 72 |thePICT |= conver|
|00001750| 74 54 6f 50 69 78 4d 61 | 70 28 20 74 65 6d 70 2c |tToPixMa|p( temp,|
|00001760| 20 72 65 71 75 65 73 74 | 65 64 44 65 70 74 68 2c | request|edDepth,|
|00001770| 20 74 68 65 4e 65 77 43 | 6f 6c 6f 72 54 61 62 6c | theNewC|olorTabl|
|00001780| 65 2c 20 6d 61 6b 65 54 | 72 61 6e 73 70 61 72 65 |e, makeT|ranspare|
|00001790| 6e 74 2c 20 6d 6f 64 65 | 29 3b 0d 09 09 4b 69 6c |nt, mode|);...Kil|
|000017a0| 6c 50 69 63 74 75 72 65 | 28 20 74 65 6d 70 29 3b |lPicture|( temp);|
|000017b0| 0d 09 09 44 69 73 70 6f | 73 65 48 61 6e 64 6c 65 |...Dispo|seHandle|
|000017c0| 28 20 28 48 61 6e 64 6c | 65 29 74 68 65 4e 65 77 |( (Handl|e)theNew|
|000017d0| 43 6f 6c 6f 72 54 61 62 | 6c 65 29 3b 0d 09 09 2f |ColorTab|le);.../|
|000017e0| 2f 0d 09 09 2f 2f 20 77 | 72 69 74 65 20 74 68 65 |/...// w|rite the|
|000017f0| 20 72 65 73 75 6c 74 69 | 6e 67 20 50 69 63 74 75 | resulti|ng Pictu|
|00001800| 72 65 20 74 6f 20 74 68 | 65 20 66 69 6c 65 3a 0d |re to th|e file:.|
|00001810| 09 09 2f 2f 20 28 4e 6f | 74 65 3a 20 74 68 65 20 |..// (No|te: the |
|00001820| 6f 72 64 65 72 20 6f 66 | 20 57 72 69 74 65 50 69 |order of| WritePi|
|00001830| 63 74 46 69 6c 65 2c 20 | 57 72 69 74 65 50 69 63 |ctFile, |WritePic|
|00001840| 74 52 65 73 6f 75 72 63 | 65 20 69 73 20 69 6d 70 |tResourc|e is imp|
|00001850| 6f 72 74 61 6e 74 3b 0d | 09 09 2f 2f 20 57 72 69 |ortant;.|..// Wri|
|00001860| 74 65 50 69 63 74 46 69 | 6c 65 20 72 65 70 6c 61 |tePictFi|le repla|
|00001870| 63 65 73 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |ces the |original|
|00001880| 20 66 69 6c 65 73 2c 20 | 57 72 69 74 65 50 69 63 | files, |WritePic|
|00001890| 74 52 65 73 6f 75 72 63 | 65 20 75 70 64 61 74 65 |tResourc|e update|
|000018a0| 73 20 69 74 2e 0d 09 09 | 2f 2f 0d 09 09 69 66 28 |s it....|//...if(|
|000018b0| 20 77 68 69 63 68 53 74 | 6f 72 61 67 65 20 21 3d | whichSt|orage !=|
|000018c0| 20 69 50 49 43 54 52 65 | 73 6f 75 72 63 65 29 0d | iPICTRe|source).|
|000018d0| 09 09 7b 0d 09 09 09 57 | 72 69 74 65 50 69 63 74 |..{....W|ritePict|
|000018e0| 46 69 6c 65 28 20 74 68 | 65 66 73 73 70 65 63 2c |File( th|efsspec,|
|000018f0| 20 74 68 65 50 49 43 54 | 29 3b 0d 09 09 09 28 76 | thePICT|);....(v|
|00001900| 6f 69 64 29 74 68 65 66 | 73 73 70 65 63 2e 53 65 |oid)thef|sspec.Se|
|00001910| 74 46 54 79 70 65 28 20 | 27 50 49 43 54 27 29 3b |tFType( |'PICT');|
|00001920| 0d 09 09 7d 0d 09 09 69 | 66 28 20 77 68 69 63 68 |...}...i|f( which|
|00001930| 53 74 6f 72 61 67 65 20 | 21 3d 20 69 50 69 63 74 |Storage |!= iPict|
|00001940| 46 69 6c 65 29 0d 09 09 | 7b 0d 09 09 09 57 72 69 |File)...|{....Wri|
|00001950| 74 65 50 69 63 74 52 65 | 73 6f 75 72 63 65 28 20 |tePictRe|source( |
|00001960| 74 68 65 66 73 73 70 65 | 63 2c 20 74 68 65 50 49 |thefsspe|c, thePI|
|00001970| 43 54 29 3b 0d 09 09 7d | 0d 09 09 4b 69 6c 6c 50 |CT);...}|...KillP|
|00001980| 69 63 74 75 72 65 28 20 | 74 68 65 50 49 43 54 29 |icture( |thePICT)|
|00001990| 3b 0d 09 7d 0d 7d 0d 0d | 76 6f 69 64 20 70 69 78 |;..}.}..|void pix|
|000019a0| 65 6c 69 7a 65 5f 73 68 | 65 6c 6c 3a 3a 48 61 6e |elize_sh|ell::Han|
|000019b0| 64 6c 65 44 69 61 6c 6f | 67 45 76 65 6e 74 28 20 |dleDialo|gEvent( |
|000019c0| 73 68 6f 72 74 20 69 74 | 65 6d 48 69 74 2c 20 44 |short it|emHit, D|
|000019d0| 69 61 6c 6f 67 50 74 72 | 20 74 68 65 44 69 61 6c |ialogPtr| theDial|
|000019e0| 6f 67 29 0d 7b 0d 09 73 | 77 69 74 63 68 28 20 69 |og).{..s|witch( i|
|000019f0| 74 65 6d 48 69 74 29 0d | 09 7b 0d 09 09 63 61 73 |temHit).|.{...cas|
|00001a00| 65 20 69 42 6c 61 63 6b | 41 6e 64 57 68 69 74 65 |e iBlack|AndWhite|
|00001a10| 3a 0d 09 09 63 61 73 65 | 20 69 32 42 69 74 73 3a |:...case| i2Bits:|
|00001a20| 0d 09 09 63 61 73 65 20 | 69 34 42 69 74 73 3a 0d |...case |i4Bits:.|
|00001a30| 09 09 63 61 73 65 20 69 | 38 42 69 74 73 3a 0d 09 |..case i|8Bits:..|
|00001a40| 09 09 43 68 61 6e 67 65 | 44 65 70 74 68 28 20 69 |..Change|Depth( i|
|00001a50| 74 65 6d 48 69 74 29 3b | 0d 09 09 09 62 72 65 61 |temHit);|....brea|
|00001a60| 6b 3b 0d 0d 09 09 63 61 | 73 65 20 69 43 6f 75 6e |k;....ca|se iCoun|
|00001a70| 74 50 69 78 65 6c 73 3a | 0d 09 09 09 63 6f 75 6e |tPixels:|....coun|
|00001a80| 74 50 69 78 65 6c 73 20 | 3d 20 21 63 6f 75 6e 74 |tPixels |= !count|
|00001a90| 50 69 78 65 6c 73 3b 0d | 09 09 09 53 65 74 41 42 |Pixels;.|...SetAB|
|00001aa0| 75 74 74 6f 6e 28 20 69 | 43 6f 75 6e 74 50 69 78 |utton( i|CountPix|
|00001ab0| 65 6c 73 2c 20 63 6f 75 | 6e 74 50 69 78 65 6c 73 |els, cou|ntPixels|
|00001ac0| 29 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 0d 09 09 |);....br|eak;....|
|00001ad0| 63 61 73 65 20 69 41 6c | 77 61 79 73 41 64 64 42 |case iAl|waysAddB|
|00001ae0| 57 3a 0d 09 09 09 61 6c | 77 61 79 73 41 64 64 42 |W:....al|waysAddB|
|00001af0| 57 20 3d 20 21 61 6c 77 | 61 79 73 41 64 64 42 57 |W = !alw|aysAddBW|
|00001b00| 3b 0d 09 09 09 53 65 74 | 41 42 75 74 74 6f 6e 28 |;....Set|AButton(|
|00001b10| 20 69 41 6c 77 61 79 73 | 41 64 64 42 57 2c 20 61 | iAlways|AddBW, a|
|00001b20| 6c 77 61 79 73 41 64 64 | 42 57 29 3b 0d 09 09 09 |lwaysAdd|BW);....|
|00001b30| 62 72 65 61 6b 3b 0d 0d | 09 09 63 61 73 65 20 69 |break;..|..case i|
|00001b40| 43 4c 55 54 53 65 6c 65 | 63 74 69 6f 6e 3a 0d 09 |CLUTSele|ction:..|
|00001b50| 09 09 7b 0d 09 09 09 09 | 73 68 6f 72 74 09 69 54 |..{.....|short.iT|
|00001b60| 79 70 65 3b 0d 09 09 09 | 09 48 61 6e 64 6c 65 09 |ype;....|.Handle.|
|00001b70| 69 48 61 6e 64 6c 65 3b | 0d 09 09 09 09 52 65 63 |iHandle;|.....Rec|
|00001b80| 74 09 69 52 65 63 74 3b | 0d 09 09 09 09 47 65 74 |t.iRect;|.....Get|
|00001b90| 44 69 61 6c 6f 67 49 74 | 65 6d 28 20 67 4d 61 69 |DialogIt|em( gMai|
|00001ba0| 6e 44 69 61 6c 6f 67 2c | 20 69 43 4c 55 54 53 65 |nDialog,| iCLUTSe|
|00001bb0| 6c 65 63 74 69 6f 6e 2c | 20 26 69 54 79 70 65 2c |lection,| &iType,|
|00001bc0| 20 26 69 48 61 6e 64 6c | 65 2c 20 26 69 52 65 63 | &iHandl|e, &iRec|
|00001bd0| 74 29 3b 0d 09 09 09 09 | 77 68 69 63 68 53 61 6d |t);.....|whichSam|
|00001be0| 70 6c 69 6e 67 20 3d 20 | 47 65 74 43 6f 6e 74 72 |pling = |GetContr|
|00001bf0| 6f 6c 56 61 6c 75 65 28 | 20 28 43 6f 6e 74 72 6f |olValue(| (Contro|
|00001c00| 6c 48 61 6e 64 6c 65 29 | 69 48 61 6e 64 6c 65 29 |lHandle)|iHandle)|
|00001c10| 3b 0d 09 09 09 09 43 68 | 61 6e 67 65 53 61 6d 70 |;.....Ch|angeSamp|
|00001c20| 6c 69 6e 67 28 20 77 68 | 69 63 68 53 61 6d 70 6c |ling( wh|ichSampl|
|00001c30| 69 6e 67 29 3b 09 09 2f | 2f 20 73 6c 69 67 68 74 |ing);../|/ slight|
|00001c40| 20 6f 76 65 72 6b 69 6c | 6c 2c 20 73 65 74 73 20 | overkil|l, sets |
|00001c50| 63 6f 6e 74 72 6f 6c 20 | 76 61 6c 75 65 0d 09 09 |control |value...|
|00001c60| 09 7d 0d 09 09 09 62 72 | 65 61 6b 3b 0d 0d 09 09 |.}....br|eak;....|
|00001c70| 63 61 73 65 20 69 54 72 | 61 6e 73 70 61 72 65 6e |case iTr|ansparen|
|00001c80| 74 3a 0d 09 09 09 6d 61 | 6b 65 54 72 61 6e 73 70 |t:....ma|keTransp|
|00001c90| 61 72 65 6e 74 20 3d 20 | 21 6d 61 6b 65 54 72 61 |arent = |!makeTra|
|00001ca0| 6e 73 70 61 72 65 6e 74 | 3b 0d 09 09 09 53 65 74 |nsparent|;....Set|
|00001cb0| 41 42 75 74 74 6f 6e 28 | 20 69 54 72 61 6e 73 70 |AButton(| iTransp|
|00001cc0| 61 72 65 6e 74 2c 20 6d | 61 6b 65 54 72 61 6e 73 |arent, m|akeTrans|
|00001cd0| 70 61 72 65 6e 74 29 3b | 0d 09 09 09 62 72 65 61 |parent);|....brea|
|00001ce0| 6b 3b 0d 0d 09 09 63 61 | 73 65 20 69 44 69 74 68 |k;....ca|se iDith|
|00001cf0| 65 72 3a 0d 09 09 09 64 | 69 74 68 65 72 20 3d 20 |er:....d|ither = |
|00001d00| 21 64 69 74 68 65 72 3b | 0d 09 09 09 53 65 74 41 |!dither;|....SetA|
|00001d10| 42 75 74 74 6f 6e 28 20 | 69 44 69 74 68 65 72 2c |Button( |iDither,|
|00001d20| 20 64 69 74 68 65 72 29 | 3b 0d 09 09 09 62 72 65 | dither)|;....bre|
|00001d30| 61 6b 3b 0d 0d 09 09 63 | 61 73 65 20 69 54 72 61 |ak;....c|ase iTra|
|00001d40| 6e 73 66 65 72 4d 6f 64 | 65 3a 0d 09 09 09 7b 0d |nsferMod|e:....{.|
|00001d50| 09 09 09 09 73 68 6f 72 | 74 09 69 54 79 70 65 3b |....shor|t.iType;|
|00001d60| 0d 09 09 09 09 48 61 6e | 64 6c 65 09 69 48 61 6e |.....Han|dle.iHan|
|00001d70| 64 6c 65 3b 0d 09 09 09 | 09 52 65 63 74 09 69 52 |dle;....|.Rect.iR|
|00001d80| 65 63 74 3b 0d 09 09 09 | 09 47 65 74 44 69 61 6c |ect;....|.GetDial|
|00001d90| 6f 67 49 74 65 6d 28 20 | 67 4d 61 69 6e 44 69 61 |ogItem( |gMainDia|
|00001da0| 6c 6f 67 2c 20 69 54 72 | 61 6e 73 66 65 72 4d 6f |log, iTr|ansferMo|
|00001db0| 64 65 2c 20 26 69 54 79 | 70 65 2c 20 26 69 48 61 |de, &iTy|pe, &iHa|
|00001dc0| 6e 64 6c 65 2c 20 26 69 | 52 65 63 74 29 3b 0d 09 |ndle, &i|Rect);..|
|00001dd0| 09 09 09 77 68 69 63 68 | 54 72 61 6e 73 66 65 72 |...which|Transfer|
|00001de0| 6d 6f 64 65 20 3d 20 47 | 65 74 43 6f 6e 74 72 6f |mode = G|etContro|
|00001df0| 6c 56 61 6c 75 65 28 20 | 28 43 6f 6e 74 72 6f 6c |lValue( |(Control|
|00001e00| 48 61 6e 64 6c 65 29 69 | 48 61 6e 64 6c 65 29 3b |Handle)i|Handle);|
|00001e10| 0d 09 09 09 7d 0d 09 09 | 09 62 72 65 61 6b 3b 0d |....}...|.break;.|
|00001e20| 0d 09 09 63 61 73 65 20 | 69 50 69 63 74 46 69 6c |...case |iPictFil|
|00001e30| 65 3a 0d 09 09 63 61 73 | 65 20 69 50 49 43 54 52 |e:...cas|e iPICTR|
|00001e40| 65 73 6f 75 72 63 65 3a | 0d 09 09 63 61 73 65 20 |esource:|...case |
|00001e50| 69 42 6f 74 68 3a 0d 09 | 09 09 43 68 61 6e 67 65 |iBoth:..|..Change|
|00001e60| 53 74 6f 72 61 67 65 28 | 20 69 74 65 6d 48 69 74 |Storage(| itemHit|
|00001e70| 29 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 7d 0d |);....br|eak;..}.|
|00001e80| 7d 0d 0d 76 6f 69 64 20 | 70 69 78 65 6c 69 7a 65 |}..void |pixelize|
|00001e90| 5f 73 68 65 6c 6c 3a 3a | 43 68 61 6e 67 65 44 65 |_shell::|ChangeDe|
|00001ea0| 70 74 68 28 20 69 6e 74 | 20 6e 65 77 44 65 70 74 |pth( int| newDept|
|00001eb0| 68 29 0d 7b 0d 09 53 65 | 74 4f 6e 6c 79 4f 6e 65 |h).{..Se|tOnlyOne|
|00001ec0| 28 20 69 42 6c 61 63 6b | 41 6e 64 57 68 69 74 65 |( iBlack|AndWhite|
|00001ed0| 2c 20 69 38 42 69 74 73 | 2c 20 6e 65 77 44 65 70 |, i8Bits|, newDep|
|00001ee0| 74 68 29 3b 0d 09 77 68 | 69 63 68 44 65 70 74 68 |th);..wh|ichDepth|
|00001ef0| 20 3d 20 6e 65 77 44 65 | 70 74 68 3b 0d 7d 0d 0d | = newDe|pth;.}..|
|00001f00| 76 6f 69 64 20 70 69 78 | 65 6c 69 7a 65 5f 73 68 |void pix|elize_sh|
|00001f10| 65 6c 6c 3a 3a 43 68 61 | 6e 67 65 53 74 6f 72 61 |ell::Cha|ngeStora|
|00001f20| 67 65 28 20 69 6e 74 20 | 6e 65 77 53 74 6f 72 61 |ge( int |newStora|
|00001f30| 67 65 29 0d 7b 0d 09 53 | 65 74 4f 6e 6c 79 4f 6e |ge).{..S|etOnlyOn|
|00001f40| 65 28 20 69 50 69 63 74 | 46 69 6c 65 2c 20 69 42 |e( iPict|File, iB|
|00001f50| 6f 74 68 2c 20 6e 65 77 | 53 74 6f 72 61 67 65 29 |oth, new|Storage)|
|00001f60| 3b 0d 09 77 68 69 63 68 | 53 74 6f 72 61 67 65 20 |;..which|Storage |
|00001f70| 3d 20 6e 65 77 53 74 6f | 72 61 67 65 3b 0d 7d 0d |= newSto|rage;.}.|
|00001f80| 0d 76 6f 69 64 20 70 69 | 78 65 6c 69 7a 65 5f 73 |.void pi|xelize_s|
|00001f90| 68 65 6c 6c 3a 3a 43 68 | 61 6e 67 65 53 61 6d 70 |hell::Ch|angeSamp|
|00001fa0| 6c 69 6e 67 28 20 69 6e | 74 20 6e 65 77 53 61 6d |ling( in|t newSam|
|00001fb0| 70 6c 69 6e 67 29 0d 7b | 0d 09 73 68 6f 72 74 09 |pling).{|..short.|
|00001fc0| 69 54 79 70 65 3b 0d 09 | 48 61 6e 64 6c 65 09 69 |iType;..|Handle.i|
|00001fd0| 48 61 6e 64 6c 65 3b 0d | 09 52 65 63 74 09 69 52 |Handle;.|.Rect.iR|
|00001fe0| 65 63 74 3b 0d 09 47 65 | 74 44 69 61 6c 6f 67 49 |ect;..Ge|tDialogI|
|00001ff0| 74 65 6d 28 20 67 4d 61 | 69 6e 44 69 61 6c 6f 67 |tem( gMa|inDialog|
|00002000| 2c 20 69 43 4c 55 54 53 | 65 6c 65 63 74 69 6f 6e |, iCLUTS|election|
|00002010| 2c 20 26 69 54 79 70 65 | 2c 20 26 69 48 61 6e 64 |, &iType|, &iHand|
|00002020| 6c 65 2c 20 26 69 52 65 | 63 74 29 3b 0d 09 53 65 |le, &iRe|ct);..Se|
|00002030| 74 43 6f 6e 74 72 6f 6c | 56 61 6c 75 65 28 20 28 |tControl|Value( (|
|00002040| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 29 69 48 |ControlH|andle)iH|
|00002050| 61 6e 64 6c 65 2c 20 6e | 65 77 53 61 6d 70 6c 69 |andle, n|ewSampli|
|00002060| 6e 67 29 3b 0d 0d 09 77 | 68 69 63 68 53 61 6d 70 |ng);...w|hichSamp|
|00002070| 6c 69 6e 67 20 3d 20 6e | 65 77 53 61 6d 70 6c 69 |ling = n|ewSampli|
|00002080| 6e 67 3b 0d 0d 09 63 6f | 6e 73 74 20 69 6e 74 20 |ng;...co|nst int |
|00002090| 74 68 65 48 69 6c 69 74 | 65 20 3d 20 28 77 68 69 |theHilit|e = (whi|
|000020a0| 63 68 53 61 6d 70 6c 69 | 6e 67 20 3d 3d 20 75 73 |chSampli|ng == us|
|000020b0| 65 53 79 73 74 65 6d 44 | 65 66 61 75 6c 74 29 20 |eSystemD|efault) |
|000020c0| 3f 20 32 35 35 20 3a 20 | 30 3b 0d 0d 09 47 65 74 |? 255 : |0;...Get|
|000020d0| 44 69 61 6c 6f 67 49 74 | 65 6d 28 20 67 4d 61 69 |DialogIt|em( gMai|
|000020e0| 6e 44 69 61 6c 6f 67 2c | 20 69 43 6f 75 6e 74 50 |nDialog,| iCountP|
|000020f0| 69 78 65 6c 73 2c 20 26 | 69 54 79 70 65 2c 20 26 |ixels, &|iType, &|
|00002100| 69 48 61 6e 64 6c 65 2c | 20 26 69 52 65 63 74 29 |iHandle,| &iRect)|
|00002110| 3b 0d 09 48 69 6c 69 74 | 65 43 6f 6e 74 72 6f 6c |;..Hilit|eControl|
|00002120| 28 20 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |( (Contr|olHandle|
|00002130| 29 69 48 61 6e 64 6c 65 | 2c 20 74 68 65 48 69 6c |)iHandle|, theHil|
|00002140| 69 74 65 29 3b 0d 0d 09 | 47 65 74 44 69 61 6c 6f |ite);...|GetDialo|
|00002150| 67 49 74 65 6d 28 20 67 | 4d 61 69 6e 44 69 61 6c |gItem( g|MainDial|
|00002160| 6f 67 2c 20 69 41 6c 77 | 61 79 73 41 64 64 42 57 |og, iAlw|aysAddBW|
|00002170| 2c 20 26 69 54 79 70 65 | 2c 20 26 69 48 61 6e 64 |, &iType|, &iHand|
|00002180| 6c 65 2c 20 26 69 52 65 | 63 74 29 3b 0d 09 48 69 |le, &iRe|ct);..Hi|
|00002190| 6c 69 74 65 43 6f 6e 74 | 72 6f 6c 28 20 28 43 6f |liteCont|rol( (Co|
|000021a0| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 29 69 48 61 6e |ntrolHan|dle)iHan|
|000021b0| 64 6c 65 2c 20 74 68 65 | 48 69 6c 69 74 65 29 3b |dle, the|Hilite);|
|000021c0| 0d 7d 0d 0d 76 6f 69 64 | 20 70 69 78 65 6c 69 7a |.}..void| pixeliz|
|000021d0| 65 5f 73 68 65 6c 6c 3a | 3a 43 68 61 6e 67 65 4d |e_shell:|:ChangeM|
|000021e0| 6f 64 65 28 20 69 6e 74 | 20 6e 65 77 54 72 61 6e |ode( int| newTran|
|000021f0| 73 66 65 72 6d 6f 64 65 | 29 0d 7b 0d 09 73 68 6f |sfermode|).{..sho|
|00002200| 72 74 09 69 54 79 70 65 | 3b 0d 09 48 61 6e 64 6c |rt.iType|;..Handl|
|00002210| 65 09 69 48 61 6e 64 6c | 65 3b 0d 09 52 65 63 74 |e.iHandl|e;..Rect|
|00002220| 09 69 52 65 63 74 3b 0d | 09 47 65 74 44 69 61 6c |.iRect;.|.GetDial|
|00002230| 6f 67 49 74 65 6d 28 20 | 67 4d 61 69 6e 44 69 61 |ogItem( |gMainDia|
|00002240| 6c 6f 67 2c 20 69 54 72 | 61 6e 73 66 65 72 4d 6f |log, iTr|ansferMo|
|00002250| 64 65 2c 20 26 69 54 79 | 70 65 2c 20 26 69 48 61 |de, &iTy|pe, &iHa|
|00002260| 6e 64 6c 65 2c 20 26 69 | 52 65 63 74 29 3b 0d 09 |ndle, &i|Rect);..|
|00002270| 53 65 74 43 6f 6e 74 72 | 6f 6c 56 61 6c 75 65 28 |SetContr|olValue(|
|00002280| 20 28 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 29 | (Contro|lHandle)|
|00002290| 69 48 61 6e 64 6c 65 2c | 20 6e 65 77 54 72 61 6e |iHandle,| newTran|
|000022a0| 73 66 65 72 6d 6f 64 65 | 29 3b 0d 0d 09 77 68 69 |sfermode|);...whi|
|000022b0| 63 68 54 72 61 6e 73 66 | 65 72 6d 6f 64 65 20 3d |chTransf|ermode =|
|000022c0| 20 6e 65 77 54 72 61 6e | 73 66 65 72 6d 6f 64 65 | newTran|sfermode|
|000022d0| 3b 0d 7d 0d 0d 76 6f 69 | 64 20 70 69 78 65 6c 69 |;.}..voi|d pixeli|
|000022e0| 7a 65 5f 73 68 65 6c 6c | 3a 3a 53 65 74 41 42 75 |ze_shell|::SetABu|
|000022f0| 74 74 6f 6e 28 20 73 68 | 6f 72 74 20 74 68 65 49 |tton( sh|ort theI|
|00002300| 74 65 6d 2c 20 42 6f 6f | 6c 65 61 6e 20 74 68 65 |tem, Boo|lean the|
|00002310| 56 61 6c 75 65 29 20 63 | 6f 6e 73 74 0d 7b 0d 09 |Value) c|onst.{..|
|00002320| 73 68 6f 72 74 09 69 54 | 79 70 65 3b 0d 09 48 61 |short.iT|ype;..Ha|
|00002330| 6e 64 6c 65 09 69 48 61 | 6e 64 6c 65 3b 0d 09 52 |ndle.iHa|ndle;..R|
|00002340| 65 63 74 09 69 52 65 63 | 74 3b 0d 09 47 65 74 44 |ect.iRec|t;..GetD|
|00002350| 69 61 6c 6f 67 49 74 65 | 6d 28 20 67 4d 61 69 6e |ialogIte|m( gMain|
|00002360| 44 69 61 6c 6f 67 2c 20 | 74 68 65 49 74 65 6d 2c |Dialog, |theItem,|
|00002370| 20 26 69 54 79 70 65 2c | 20 26 69 48 61 6e 64 6c | &iType,| &iHandl|
|00002380| 65 2c 20 26 69 52 65 63 | 74 29 3b 0d 09 53 65 74 |e, &iRec|t);..Set|
|00002390| 43 6f 6e 74 72 6f 6c 56 | 61 6c 75 65 28 20 28 43 |ControlV|alue( (C|
|000023a0| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 29 69 48 61 |ontrolHa|ndle)iHa|
|000023b0| 6e 64 6c 65 2c 20 74 68 | 65 56 61 6c 75 65 29 3b |ndle, th|eValue);|
|000023c0| 0d 7d 0d 0d 76 6f 69 64 | 20 70 69 78 65 6c 69 7a |.}..void| pixeliz|
|000023d0| 65 5f 73 68 65 6c 6c 3a | 3a 53 65 74 4f 6e 6c 79 |e_shell:|:SetOnly|
|000023e0| 4f 6e 65 28 20 73 68 6f | 72 74 20 66 69 72 73 74 |One( sho|rt first|
|000023f0| 49 74 65 6d 2c 20 73 68 | 6f 72 74 20 6c 61 73 74 |Item, sh|ort last|
|00002400| 49 74 65 6d 2c 20 73 68 | 6f 72 74 20 49 74 65 6d |Item, sh|ort Item|
|00002410| 54 6f 53 65 74 29 0d 7b | 0d 09 73 68 6f 72 74 09 |ToSet).{|..short.|
|00002420| 69 54 79 70 65 3b 0d 09 | 48 61 6e 64 6c 65 09 69 |iType;..|Handle.i|
|00002430| 48 61 6e 64 6c 65 3b 0d | 09 52 65 63 74 09 69 52 |Handle;.|.Rect.iR|
|00002440| 65 63 74 3b 0d 0d 09 66 | 6f 72 28 20 69 6e 74 20 |ect;...f|or( int |
|00002450| 69 20 3d 20 66 69 72 73 | 74 49 74 65 6d 3b 20 69 |i = firs|tItem; i|
|00002460| 20 3c 3d 20 6c 61 73 74 | 49 74 65 6d 3b 20 69 2b | <= last|Item; i+|
|00002470| 2b 29 0d 09 7b 0d 09 09 | 47 65 74 44 69 61 6c 6f |+)..{...|GetDialo|
|00002480| 67 49 74 65 6d 28 20 67 | 4d 61 69 6e 44 69 61 6c |gItem( g|MainDial|
|00002490| 6f 67 2c 20 69 2c 20 26 | 69 54 79 70 65 2c 20 26 |og, i, &|iType, &|
|000024a0| 69 48 61 6e 64 6c 65 2c | 20 26 69 52 65 63 74 29 |iHandle,| &iRect)|
|000024b0| 3b 0d 09 09 53 65 74 43 | 6f 6e 74 72 6f 6c 56 61 |;...SetC|ontrolVa|
|000024c0| 6c 75 65 28 20 28 43 6f | 6e 74 72 6f 6c 48 61 6e |lue( (Co|ntrolHan|
|000024d0| 64 6c 65 29 69 48 61 6e | 64 6c 65 2c 20 28 69 20 |dle)iHan|dle, (i |
|000024e0| 3d 3d 20 49 74 65 6d 54 | 6f 53 65 74 29 29 3b 0d |== ItemT|oSet));.|
|000024f0| 09 7d 0d 7d 0d 0d 50 69 | 63 48 61 6e 64 6c 65 20 |.}.}..Pi|cHandle |
|00002500| 70 69 78 65 6c 69 7a 65 | 5f 73 68 65 6c 6c 3a 3a |pixelize|_shell::|
|00002510| 52 65 61 64 50 69 63 74 | 46 69 6c 65 28 20 63 6f |ReadPict|File( co|
|00002520| 6e 73 74 20 66 73 73 70 | 65 63 20 26 74 68 65 66 |nst fssp|ec &thef|
|00002530| 73 73 70 65 63 29 20 63 | 6f 6e 73 74 0d 7b 0d 09 |sspec) c|onst.{..|
|00002540| 50 69 63 48 61 6e 64 6c | 65 20 72 65 73 75 6c 74 |PicHandl|e result|
|00002550| 20 3d 20 30 3b 0d 09 61 | 63 63 65 73 73 5f 70 61 | = 0;..a|ccess_pa|
|00002560| 74 68 20 74 68 65 66 69 | 6c 65 28 20 74 68 65 66 |th thefi|le( thef|
|00002570| 73 73 70 65 63 2c 20 66 | 73 52 64 50 65 72 6d 29 |sspec, f|sRdPerm)|
|00002580| 3b 0d 0d 09 4f 53 45 72 | 72 20 65 72 72 20 3d 20 |;...OSEr|r err = |
|00002590| 74 68 65 66 69 6c 65 28 | 29 3b 0d 0d 09 6c 6f 6e |thefile(|);...lon|
|000025a0| 67 20 70 69 63 74 75 72 | 65 5f 73 69 7a 65 20 3d |g pictur|e_size =|
|000025b0| 20 30 3b 0d 09 65 72 72 | 20 3d 20 74 68 65 66 69 | 0;..err| = thefi|
|000025c0| 6c 65 2e 47 65 74 45 4f | 46 28 20 26 70 69 63 74 |le.GetEO|F( &pict|
|000025d0| 75 72 65 5f 73 69 7a 65 | 29 3b 0d 0d 09 70 69 63 |ure_size|);...pic|
|000025e0| 74 75 72 65 5f 73 69 7a | 65 20 2d 3d 20 30 78 30 |ture_siz|e -= 0x0|
|000025f0| 32 30 30 3b 0d 0d 09 65 | 72 72 20 3d 20 74 68 65 |200;...e|rr = the|
|00002600| 66 69 6c 65 2e 53 65 74 | 46 50 6f 73 28 20 30 78 |file.Set|FPos( 0x|
|00002610| 30 32 30 30 29 3b 0d 0d | 09 69 66 28 20 65 72 72 |0200);..|.if( err|
|00002620| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 7b 0d 09 09 | == noEr|r)..{...|
|00002630| 72 65 73 75 6c 74 20 3d | 20 28 50 69 63 48 61 6e |result =| (PicHan|
|00002640| 64 6c 65 29 4e 65 77 48 | 61 6e 64 6c 65 28 20 70 |dle)NewH|andle( p|
|00002650| 69 63 74 75 72 65 5f 73 | 69 7a 65 29 3b 0d 09 09 |icture_s|ize);...|
|00002660| 48 4c 6f 63 6b 28 20 28 | 48 61 6e 64 6c 65 29 72 |HLock( (|Handle)r|
|00002670| 65 73 75 6c 74 29 3b 0d | 09 09 09 65 72 72 20 3d |esult);.|...err =|
|00002680| 20 74 68 65 66 69 6c 65 | 2e 52 65 61 64 28 20 26 | thefile|.Read( &|
|00002690| 70 69 63 74 75 72 65 5f | 73 69 7a 65 2c 20 28 63 |picture_|size, (c|
|000026a0| 68 61 72 20 2a 29 2a 72 | 65 73 75 6c 74 29 3b 0d |har *)*r|esult);.|
|000026b0| 09 09 48 55 6e 6c 6f 63 | 6b 28 20 28 48 61 6e 64 |..HUnloc|k( (Hand|
|000026c0| 6c 65 29 72 65 73 75 6c | 74 29 3b 0d 09 09 69 66 |le)resul|t);...if|
|000026d0| 28 20 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 0d |( err !=| noErr).|
|000026e0| 09 09 7b 0d 09 09 09 44 | 69 73 70 6f 73 65 48 61 |..{....D|isposeHa|
|000026f0| 6e 64 6c 65 28 20 28 48 | 61 6e 64 6c 65 29 72 65 |ndle( (H|andle)re|
|00002700| 73 75 6c 74 29 3b 0d 09 | 09 09 72 65 73 75 6c 74 |sult);..|..result|
|00002710| 20 3d 20 30 3b 0d 09 09 | 7d 0d 09 7d 0d 09 65 72 | = 0;...|}..}..er|
|00002720| 72 20 3d 20 74 68 65 66 | 69 6c 65 2e 43 6c 6f 73 |r = thef|ile.Clos|
|00002730| 65 28 29 3b 0d 0d 09 72 | 65 74 75 72 6e 20 72 65 |e();...r|eturn re|
|00002740| 73 75 6c 74 3b 0d 7d 0d | 0d 50 69 63 48 61 6e 64 |sult;.}.|.PicHand|
|00002750| 6c 65 20 70 69 78 65 6c | 69 7a 65 5f 73 68 65 6c |le pixel|ize_shel|
|00002760| 6c 3a 3a 52 65 61 64 50 | 69 63 74 52 65 73 6f 75 |l::ReadP|ictResou|
|00002770| 72 63 65 28 20 63 6f 6e | 73 74 20 66 73 73 70 65 |rce( con|st fsspe|
|00002780| 63 20 26 74 68 65 66 73 | 73 70 65 63 29 20 63 6f |c &thefs|spec) co|
|00002790| 6e 73 74 0d 7b 0d 09 50 | 69 63 48 61 6e 64 6c 65 |nst.{..P|icHandle|
|000027a0| 20 72 65 73 75 6c 74 20 | 3d 20 30 3b 0d 09 72 65 | result |= 0;..re|
|000027b0| 73 6f 75 72 63 65 66 69 | 6c 65 20 74 68 65 66 69 |sourcefi|le thefi|
|000027c0| 6c 65 28 20 74 68 65 66 | 73 73 70 65 63 29 3b 0d |le( thef|sspec);.|
|000027d0| 0d 09 4f 53 45 72 72 20 | 65 72 72 20 3d 20 74 68 |..OSErr |err = th|
|000027e0| 65 66 69 6c 65 2e 4f 70 | 65 6e 28 20 66 73 52 64 |efile.Op|en( fsRd|
|000027f0| 50 65 72 6d 29 3b 0d 0d | 09 69 66 28 20 65 72 72 |Perm);..|.if( err|
|00002800| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 7b 0d 09 09 | == noEr|r)..{...|
|00002810| 72 65 73 75 6c 74 20 3d | 20 28 50 69 63 48 61 6e |result =| (PicHan|
|00002820| 64 6c 65 29 47 65 74 31 | 49 6e 64 52 65 73 6f 75 |dle)Get1|IndResou|
|00002830| 72 63 65 28 20 27 50 49 | 43 54 27 2c 20 31 29 3b |rce( 'PI|CT', 1);|
|00002840| 0d 09 09 44 65 74 61 63 | 68 52 65 73 6f 75 72 63 |...Detac|hResourc|
|00002850| 65 28 20 28 48 61 6e 64 | 6c 65 29 20 72 65 73 75 |e( (Hand|le) resu|
|00002860| 6c 74 29 3b 0d 09 7d 0d | 09 65 72 72 20 3d 20 74 |lt);..}.|.err = t|
|00002870| 68 65 66 69 6c 65 2e 43 | 6c 6f 73 65 28 29 3b 0d |hefile.C|lose();.|
|00002880| 0d 09 72 65 74 75 72 6e | 20 72 65 73 75 6c 74 3b |..return| result;|
|00002890| 0d 7d 0d 0d 50 69 63 48 | 61 6e 64 6c 65 20 70 69 |.}..PicH|andle pi|
|000028a0| 78 65 6c 69 7a 65 5f 73 | 68 65 6c 6c 3a 3a 52 65 |xelize_s|hell::Re|
|000028b0| 61 64 5f 70 67 6d 5f 66 | 69 6c 65 28 20 63 6f 6e |ad_pgm_f|ile( con|
|000028c0| 73 74 20 66 73 73 70 65 | 63 20 26 74 68 65 66 73 |st fsspe|c &thefs|
|000028d0| 73 70 65 63 29 20 63 6f | 6e 73 74 0d 7b 0d 09 50 |spec) co|nst.{..P|
|000028e0| 69 63 48 61 6e 64 6c 65 | 20 72 65 73 75 6c 74 20 |icHandle| result |
|000028f0| 3d 20 30 3b 0d 09 61 63 | 63 65 73 73 5f 70 61 74 |= 0;..ac|cess_pat|
|00002900| 68 20 74 68 65 66 69 6c | 65 28 20 74 68 65 66 73 |h thefil|e( thefs|
|00002910| 73 70 65 63 2c 20 66 73 | 52 64 50 65 72 6d 29 3b |spec, fs|RdPerm);|
|00002920| 0d 0d 09 4f 53 45 72 72 | 20 65 72 72 20 3d 20 74 |...OSErr| err = t|
|00002930| 68 65 66 69 6c 65 28 29 | 3b 0d 0d 09 69 66 28 20 |hefile()|;...if( |
|00002940| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 29 0d 09 7b |err == n|oErr)..{|
|00002950| 0d 09 09 23 64 65 66 69 | 6e 65 20 6d 61 78 4c 65 |...#defi|ne maxLe|
|00002960| 6e 67 74 68 20 32 30 30 | 0d 09 09 74 79 70 65 64 |ngth 200|...typed|
|00002970| 65 66 20 73 74 72 75 63 | 74 20 70 67 6d 0d 09 09 |ef struc|t pgm...|
|00002980| 7b 0d 09 09 09 73 68 6f | 72 74 20 50 35 3b 0d 09 |{....sho|rt P5;..|
|00002990| 09 09 63 68 61 72 20 66 | 69 72 73 74 4c 69 6e 65 |..char f|irstLine|
|000029a0| 5b 20 6d 61 78 4c 65 6e | 67 74 68 5d 3b 0d 09 09 |[ maxLen|gth];...|
|000029b0| 7d 20 70 67 6d 3b 0d 09 | 09 73 74 72 75 63 74 20 |} pgm;..|.struct |
|000029c0| 70 67 6d 20 74 68 65 50 | 47 4d 3b 0d 09 09 6c 6f |pgm theP|GM;...lo|
|000029d0| 6e 67 20 63 6f 75 6e 74 | 20 3d 20 73 69 7a 65 6f |ng count| = sizeo|
|000029e0| 66 28 20 70 67 6d 29 3b | 0d 09 09 65 72 72 20 3d |f( pgm);|...err =|
|000029f0| 20 74 68 65 66 69 6c 65 | 2e 52 65 61 64 28 20 26 | thefile|.Read( &|
|00002a00| 63 6f 75 6e 74 2c 20 26 | 74 68 65 50 47 4d 29 3b |count, &|thePGM);|
|00002a10| 0d 0d 09 09 69 66 28 20 | 28 65 72 72 20 3d 3d 20 |....if( |(err == |
|00002a20| 6e 6f 45 72 72 29 20 26 | 26 20 28 74 68 65 50 47 |noErr) &|& (thePG|
|00002a30| 4d 2e 50 35 20 3d 3d 20 | 27 50 35 27 29 29 0d 09 |M.P5 == |'P5'))..|
|00002a40| 09 7b 0d 09 09 09 2f 2f | 0d 09 09 09 2f 2f 20 52 |.{....//|....// R|
|00002a50| 65 61 64 20 74 68 65 20 | 66 69 65 6c 64 73 20 58 |ead the |fields X|
|00002a60| 72 65 73 2c 20 59 72 65 | 73 2c 20 6d 61 78 20 76 |res, Yre|s, max v|
|00002a70| 61 6c 75 65 3a 0d 09 09 | 09 2f 2f 0d 09 09 09 69 |alue:...|.//....i|
|00002a80| 73 74 72 73 74 72 65 61 | 6d 20 69 6e 28 20 74 68 |strstrea|m in( th|
|00002a90| 65 50 47 4d 2e 66 69 72 | 73 74 4c 69 6e 65 2c 20 |ePGM.fir|stLine, |
|00002aa0| 6d 61 78 4c 65 6e 67 74 | 68 29 3b 0d 0d 09 09 09 |maxLengt|h);.....|
|00002ab0| 73 68 6f 72 74 20 6d 61 | 78 58 3b 0d 09 09 09 73 |short ma|xX;....s|
|00002ac0| 68 6f 72 74 20 6d 61 78 | 59 3b 0d 09 09 09 73 68 |hort max|Y;....sh|
|00002ad0| 6f 72 74 20 6d 61 78 56 | 61 6c 3b 0d 0d 09 09 09 |ort maxV|al;.....|
|00002ae0| 69 6e 20 3e 3e 20 6d 61 | 78 58 20 3e 3e 20 6d 61 |in >> ma|xX >> ma|
|00002af0| 78 59 20 3e 3e 20 6d 61 | 78 56 61 6c 3b 0d 09 09 |xY >> ma|xVal;...|
|00002b00| 09 2f 2f 0d 09 09 09 2f | 2f 20 46 69 6e 64 20 74 |.//..../|/ Find t|
|00002b10| 68 65 20 6c 69 6e 65 20 | 62 72 65 61 6b 3a 0d 09 |he line |break:..|
|00002b20| 09 09 2f 2f 0d 09 09 09 | 66 6f 72 28 20 69 6e 74 |..//....|for( int|
|00002b30| 20 69 20 3d 20 30 3b 20 | 69 20 3c 20 6d 61 78 4c | i = 0; |i < maxL|
|00002b40| 65 6e 67 74 68 3b 20 69 | 2b 2b 29 0d 09 09 09 7b |ength; i|++)....{|
|00002b50| 0d 09 09 09 09 63 6f 6e | 73 74 20 63 68 61 72 20 |.....con|st char |
|00002b60| 63 20 3d 20 74 68 65 50 | 47 4d 2e 66 69 72 73 74 |c = theP|GM.first|
|00002b70| 4c 69 6e 65 5b 20 69 5d | 3b 0d 0d 09 09 09 09 69 |Line[ i]|;......i|
|00002b80| 66 28 20 28 63 20 3d 3d | 20 27 5c 6e 27 29 20 7c |f( (c ==| '\n') ||
|00002b90| 7c 20 28 63 20 3d 3d 20 | 27 5c 72 27 29 29 0d 09 || (c == |'\r'))..|
|00002ba0| 09 09 09 7b 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |...{....|..break;|
|00002bb0| 0d 09 09 09 09 7d 0d 09 | 09 09 7d 0d 09 09 09 65 |.....}..|..}....e|
|00002bc0| 72 72 20 3d 20 74 68 65 | 66 69 6c 65 2e 53 65 74 |rr = the|file.Set|
|00002bd0| 46 50 6f 73 28 20 69 20 | 2b 20 31 20 2b 20 32 29 |FPos( i |+ 1 + 2)|
|00002be0| 3b 09 09 2f 2f 20 31 20 | 66 6f 72 20 27 5c 6e 27 |;..// 1 |for '\n'|
|00002bf0| 2c 20 32 20 66 6f 72 20 | 27 50 35 27 0d 0d 09 09 |, 2 for |'P5'....|
|00002c00| 09 43 54 61 62 48 61 6e | 64 6c 65 20 67 72 61 79 |.CTabHan|dle gray|
|00002c10| 73 20 3d 20 28 43 54 61 | 62 48 61 6e 64 6c 65 29 |s = (CTa|bHandle)|
|00002c20| 47 65 74 31 52 65 73 6f | 75 72 63 65 28 20 27 63 |Get1Reso|urce( 'c|
|00002c30| 6c 75 74 27 2c 20 31 32 | 39 29 3b 0d 09 09 09 67 |lut', 12|9);....g|
|00002c40| 77 6f 72 6c 64 20 6f 66 | 66 73 63 72 65 65 6e 28 |world of|fscreen(|
|00002c50| 20 6d 61 78 58 2c 20 6d | 61 78 59 2c 20 38 2c 20 | maxX, m|axY, 8, |
|00002c60| 74 72 75 65 2c 20 67 72 | 61 79 73 29 3b 0d 09 09 |true, gr|ays);...|
|00002c70| 09 2f 2f 0d 09 09 09 2f | 2f 20 53 74 75 66 66 20 |.//..../|/ Stuff |
|00002c80| 74 68 65 20 62 69 6e 61 | 72 79 20 64 61 74 61 20 |the bina|ry data |
|00002c90| 69 6e 20 74 68 65 20 6f | 66 66 73 63 72 65 65 6e |in the o|ffscreen|
|00002ca0| 20 62 69 74 6d 61 70 0d | 09 09 09 2f 2f 0d 09 09 | bitmap.|...//...|
|00002cb0| 09 50 69 78 4d 61 70 50 | 74 72 20 74 68 65 50 69 |.PixMapP|tr thePi|
|00002cc0| 78 20 3d 20 6f 66 66 73 | 63 72 65 65 6e 2e 67 65 |x = offs|creen.ge|
|00002cd0| 74 5f 70 69 78 48 28 29 | 3b 0d 0d 09 09 09 50 74 |t_pixH()|;.....Pt|
|00002ce0| 72 20 62 61 73 65 41 64 | 64 72 20 3d 20 74 68 65 |r baseAd|dr = the|
|00002cf0| 50 69 78 2d 3e 62 61 73 | 65 41 64 64 72 3b 0d 09 |Pix->bas|eAddr;..|
|00002d00| 09 09 63 6f 6e 73 74 20 | 73 68 6f 72 74 20 72 6f |..const |short ro|
|00002d10| 77 42 79 74 65 73 20 3d | 20 28 74 68 65 50 69 78 |wBytes =| (thePix|
|00002d20| 2d 3e 72 6f 77 42 79 74 | 65 73 29 20 26 20 28 7e |->rowByt|es) & (~|
|00002d30| 30 78 43 30 30 30 29 3b | 0d 09 09 09 2f 2f 0d 09 |0xC000);|....//..|
|00002d40| 09 09 2f 2f 20 52 65 61 | 64 20 69 6e 20 74 68 65 |..// Rea|d in the|
|00002d50| 20 62 69 6e 61 72 79 20 | 64 61 74 61 3a 0d 09 09 | binary |data:...|
|00002d60| 09 2f 2f 0d 09 09 09 66 | 6f 72 28 20 69 6e 74 20 |.//....f|or( int |
|00002d70| 79 20 3d 20 30 3b 20 28 | 79 20 3c 20 6d 61 78 59 |y = 0; (|y < maxY|
|00002d80| 29 20 26 26 20 28 65 72 | 72 20 3d 3d 20 6e 6f 45 |) && (er|r == noE|
|00002d90| 72 72 29 3b 20 79 2b 2b | 29 0d 09 09 09 7b 0d 09 |rr); y++|)....{..|
|00002da0| 09 09 09 6c 6f 6e 67 20 | 6e 75 6d 74 6f 52 65 61 |...long |numtoRea|
|00002db0| 64 20 3d 20 6d 61 78 58 | 3b 0d 09 09 09 09 65 72 |d = maxX|;.....er|
|00002dc0| 72 20 3d 20 74 68 65 66 | 69 6c 65 2e 52 65 61 64 |r = thef|ile.Read|
|00002dd0| 28 20 26 6e 75 6d 74 6f | 52 65 61 64 2c 20 62 61 |( &numto|Read, ba|
|00002de0| 73 65 41 64 64 72 29 3b | 0d 09 09 09 09 62 61 73 |seAddr);|.....bas|
|00002df0| 65 41 64 64 72 20 2b 3d | 20 72 6f 77 42 79 74 65 |eAddr +=| rowByte|
|00002e00| 73 3b 0d 09 09 09 7d 0d | 09 09 09 2f 2f 0d 09 09 |s;....}.|...//...|
|00002e10| 09 2f 2f 20 4c 6f 63 6b | 50 69 78 65 6c 73 28 20 |.// Lock|Pixels( |
|00002e20| 74 68 65 50 69 78 29 3b | 20 6e 6f 74 20 6e 65 65 |thePix);| not nee|
|00002e30| 64 65 64 3b 20 67 77 6f | 72 6c 64 20 64 6f 65 73 |ded; gwo|rld does|
|00002e40| 20 74 68 69 73 0d 09 09 | 09 2f 2f 0d 09 09 09 2f | this...|.//..../|
|00002e50| 2f 20 43 6f 6e 76 65 72 | 74 20 74 68 65 20 74 68 |/ Conver|t the th|
|00002e60| 69 6e 67 20 74 6f 20 61 | 20 70 69 63 74 75 72 65 |ing to a| picture|
|00002e70| 3a 0d 09 09 09 2f 2f 0d | 09 09 09 72 65 73 75 6c |:....//.|...resul|
|00002e80| 74 20 3d 20 6f 66 66 73 | 63 72 65 65 6e 2e 6d 61 |t = offs|creen.ma|
|00002e90| 6b 65 50 49 43 54 28 29 | 3b 0d 09 09 7d 0d 09 7d |kePICT()|;...}..}|
|00002ea0| 0d 09 65 72 72 20 3d 20 | 74 68 65 66 69 6c 65 2e |..err = |thefile.|
|00002eb0| 43 6c 6f 73 65 28 29 3b | 0d 0d 09 72 65 74 75 72 |Close();|...retur|
|00002ec0| 6e 20 72 65 73 75 6c 74 | 3b 0d 7d 0d 0d 43 54 61 |n result|;.}..CTa|
|00002ed0| 62 48 61 6e 64 6c 65 20 | 70 69 78 65 6c 69 7a 65 |bHandle |pixelize|
|00002ee0| 5f 73 68 65 6c 6c 3a 3a | 41 64 64 42 6c 61 63 6b |_shell::|AddBlack|
|00002ef0| 57 68 69 74 65 28 20 63 | 6f 6e 73 74 20 50 61 6c |White( c|onst Pal|
|00002f00| 65 74 74 65 48 61 6e 64 | 6c 65 20 74 68 65 50 61 |etteHand|le thePa|
|00002f10| 6c 65 74 74 65 29 20 63 | 6f 6e 73 74 0d 7b 0d 09 |lette) c|onst.{..|
|00002f20| 63 6f 6e 73 74 20 69 6e | 74 20 6e 75 6d 54 6f 41 |const in|t numToA|
|00002f30| 64 64 20 3d 20 28 2a 2a | 74 68 65 50 61 6c 65 74 |dd = (**|thePalet|
|00002f40| 74 65 29 2e 70 6d 45 6e | 74 72 69 65 73 3b 0d 09 |te).pmEn|tries;..|
|00002f50| 2f 2f 0d 09 2f 2f 20 42 | 75 69 6c 64 20 61 20 63 |//..// B|uild a c|
|00002f60| 6f 6c 6f 72 20 74 61 62 | 6c 65 20 77 69 74 68 20 |olor tab|le with |
|00002f70| 62 6c 61 63 6b 20 61 6e | 64 20 77 68 69 74 65 20 |black an|d white |
|00002f80| 61 64 64 65 64 3a 0d 09 | 2f 2f 0d 09 50 61 6c 65 |added:..|//..Pale|
|00002f90| 74 74 65 48 61 6e 64 6c | 65 20 6e 65 77 50 61 6c |tteHandl|e newPal|
|00002fa0| 65 74 74 65 20 3d 20 47 | 65 74 4e 65 77 50 61 6c |ette = G|etNewPal|
|00002fb0| 65 74 74 65 28 20 31 32 | 38 29 3b 09 2f 2f 20 63 |ette( 12|8);.// c|
|00002fc0| 6f 6e 74 61 69 6e 73 20 | 62 6c 61 63 6b 20 61 6e |ontains |black an|
|00002fd0| 64 20 77 68 69 74 65 0d | 0d 09 52 65 73 69 7a 65 |d white.|..Resize|
|00002fe0| 50 61 6c 65 74 74 65 28 | 20 6e 65 77 50 61 6c 65 |Palette(| newPale|
|00002ff0| 74 74 65 2c 20 6e 75 6d | 54 6f 41 64 64 20 2b 20 |tte, num|ToAdd + |
|00003000| 32 29 3b 0d 09 43 6f 70 | 79 50 61 6c 65 74 74 65 |2);..Cop|yPalette|
|00003010| 28 20 74 68 65 50 61 6c | 65 74 74 65 2c 20 6e 65 |( thePal|ette, ne|
|00003020| 77 50 61 6c 65 74 74 65 | 2c 20 31 2c 20 33 2c 20 |wPalette|, 1, 3, |
|00003030| 6e 75 6d 54 6f 41 64 64 | 29 3b 0d 0d 09 43 54 61 |numToAdd|);...CTa|
|00003040| 62 48 61 6e 64 6c 65 20 | 72 65 73 75 6c 74 20 3d |bHandle |result =|
|00003050| 20 28 43 54 61 62 48 61 | 6e 64 6c 65 29 47 65 74 | (CTabHa|ndle)Get|
|00003060| 31 52 65 73 6f 75 72 63 | 65 28 20 27 63 6c 75 74 |1Resourc|e( 'clut|
|00003070| 27 2c 20 31 32 38 29 3b | 0d 09 44 65 74 61 63 68 |', 128);|..Detach|
|00003080| 52 65 73 6f 75 72 63 65 | 28 20 28 48 61 6e 64 6c |Resource|( (Handl|
|00003090| 65 29 72 65 73 75 6c 74 | 29 3b 0d 0d 09 50 61 6c |e)result|);...Pal|
|000030a0| 65 74 74 65 32 43 54 61 | 62 28 20 74 68 65 50 61 |ette2CTa|b( thePa|
|000030b0| 6c 65 74 74 65 2c 20 72 | 65 73 75 6c 74 29 3b 0d |lette, r|esult);.|
|000030c0| 09 44 69 73 70 6f 73 65 | 48 61 6e 64 6c 65 28 20 |.Dispose|Handle( |
|000030d0| 28 48 61 6e 64 6c 65 29 | 6e 65 77 50 61 6c 65 74 |(Handle)|newPalet|
|000030e0| 74 65 29 3b 0d 09 72 65 | 74 75 72 6e 20 72 65 73 |te);..re|turn res|
|000030f0| 75 6c 74 3b 0d 7d 0d 0d | 50 69 63 48 61 6e 64 6c |ult;.}..|PicHandl|
|00003100| 65 20 70 69 78 65 6c 69 | 7a 65 5f 73 68 65 6c 6c |e pixeli|ze_shell|
|00003110| 3a 3a 63 6f 6e 76 65 72 | 74 54 6f 50 69 78 4d 61 |::conver|tToPixMa|
|00003120| 70 28 0d 09 63 6f 6e 73 | 74 20 50 69 63 48 61 6e |p(..cons|t PicHan|
|00003130| 64 6c 65 20 74 68 65 50 | 49 43 54 2c 20 73 68 6f |dle theP|ICT, sho|
|00003140| 72 74 20 62 69 74 44 65 | 70 74 68 2c 0d 09 63 6f |rt bitDe|pth,..co|
|00003150| 6e 73 74 20 43 54 61 62 | 48 61 6e 64 6c 65 20 74 |nst CTab|Handle t|
|00003160| 68 65 43 6f 6c 6f 72 54 | 61 62 6c 65 2c 20 42 6f |heColorT|able, Bo|
|00003170| 6f 6c 65 61 6e 20 74 72 | 61 6e 73 70 61 72 65 6e |olean tr|ansparen|
|00003180| 74 2c 20 73 68 6f 72 74 | 20 6d 6f 64 65 29 20 63 |t, short| mode) c|
|00003190| 6f 6e 73 74 0d 7b 0d 09 | 52 65 63 74 20 50 49 43 |onst.{..|Rect PIC|
|000031a0| 54 52 65 63 74 20 3d 20 | 28 2a 2a 74 68 65 50 49 |TRect = |(**thePI|
|000031b0| 43 54 29 2e 70 69 63 46 | 72 61 6d 65 3b 0d 09 4f |CT).picF|rame;..O|
|000031c0| 66 66 73 65 74 52 65 63 | 74 28 20 26 50 49 43 54 |ffsetRec|t( &PICT|
|000031d0| 52 65 63 74 2c 20 2d 50 | 49 43 54 52 65 63 74 2e |Rect, -P|ICTRect.|
|000031e0| 6c 65 66 74 2c 20 2d 50 | 49 43 54 52 65 63 74 2e |left, -P|ICTRect.|
|000031f0| 74 6f 70 29 3b 0d 0d 09 | 63 6f 6e 73 74 20 73 68 |top);...|const sh|
|00003200| 6f 72 74 20 50 49 43 54 | 57 69 64 74 68 20 20 3d |ort PICT|Width =|
|00003210| 20 50 49 43 54 52 65 63 | 74 2e 72 69 67 68 74 3b | PICTRec|t.right;|
|00003220| 0d 09 63 6f 6e 73 74 20 | 73 68 6f 72 74 20 50 49 |..const |short PI|
|00003230| 43 54 68 65 69 67 68 74 | 20 3d 20 50 49 43 54 52 |CTheight| = PICTR|
|00003240| 65 63 74 2e 62 6f 74 74 | 6f 6d 3b 0d 09 2f 2f 0d |ect.bott|om;..//.|
|00003250| 09 2f 2f 20 63 6f 6e 76 | 65 72 74 20 74 68 65 20 |.// conv|ert the |
|00003260| 70 69 63 74 75 72 65 20 | 74 6f 20 61 20 28 6c 61 |picture |to a (la|
|00003270| 72 67 65 29 20 70 69 63 | 74 75 72 65 20 63 6f 6e |rge) pic|ture con|
|00003280| 74 61 69 6e 69 6e 67 20 | 6f 6e 6c 79 20 61 20 70 |taining |only a p|
|00003290| 69 78 6d 61 70 0d 09 2f | 2f 0d 09 67 77 6f 72 6c |ixmap../|/..gworl|
|000032a0| 64 20 6f 66 66 73 63 72 | 65 65 6e 28 20 50 49 43 |d offscr|een( PIC|
|000032b0| 54 57 69 64 74 68 2c 20 | 50 49 43 54 68 65 69 67 |TWidth, |PICTheig|
|000032c0| 68 74 2c 20 62 69 74 44 | 65 70 74 68 2c 20 74 72 |ht, bitD|epth, tr|
|000032d0| 75 65 2c 20 74 68 65 43 | 6f 6c 6f 72 54 61 62 6c |ue, theC|olorTabl|
|000032e0| 65 29 3b 0d 09 6f 66 66 | 73 63 72 65 65 6e 2e 53 |e);..off|screen.S|
|000032f0| 65 74 28 29 3b 0d 09 44 | 72 61 77 50 69 63 74 75 |et();..D|rawPictu|
|00003300| 72 65 28 20 74 68 65 50 | 49 43 54 2c 20 26 50 49 |re( theP|ICT, &PI|
|00003310| 43 54 52 65 63 74 29 3b | 0d 0d 09 50 69 63 48 61 |CTRect);|...PicHa|
|00003320| 6e 64 6c 65 20 72 65 73 | 75 6c 74 20 3d 20 30 4c |ndle res|ult = 0L|
|00003330| 3b 0d 0d 09 69 66 28 20 | 74 72 61 6e 73 70 61 72 |;...if( |transpar|
|00003340| 65 6e 74 29 0d 09 7b 0d | 09 09 67 77 6f 72 6c 64 |ent)..{.|..gworld|
|00003350| 20 6d 61 73 6b 28 20 50 | 49 43 54 57 69 64 74 68 | mask( P|ICTWidth|
|00003360| 2c 20 50 49 43 54 68 65 | 69 67 68 74 2c 20 31 29 |, PICThe|ight, 1)|
|00003370| 3b 0d 09 09 6d 61 73 6b | 2e 53 65 74 28 29 3b 0d |;...mask|.Set();.|
|00003380| 09 09 44 72 61 77 50 69 | 63 74 75 72 65 28 20 74 |..DrawPi|cture( t|
|00003390| 68 65 50 49 43 54 2c 20 | 26 50 49 43 54 52 65 63 |hePICT, |&PICTRec|
|000033a0| 74 29 3b 0d 09 09 52 67 | 6e 48 61 6e 64 6c 65 20 |t);...Rg|nHandle |
|000033b0| 6d 61 73 6b 52 65 67 69 | 6f 6e 20 3d 20 6d 61 73 |maskRegi|on = mas|
|000033c0| 6b 2e 6d 61 6b 65 52 65 | 67 69 6f 6e 28 29 3b 0d |k.makeRe|gion();.|
|000033d0| 09 09 72 65 73 75 6c 74 | 20 3d 20 6f 66 66 73 63 |..result| = offsc|
|000033e0| 72 65 65 6e 2e 6d 61 6b | 65 50 49 43 54 28 20 6d |reen.mak|ePICT( m|
|000033f0| 6f 64 65 2c 20 6d 61 73 | 6b 52 65 67 69 6f 6e 29 |ode, mas|kRegion)|
|00003400| 3b 0d 09 09 44 69 73 70 | 6f 73 65 52 67 6e 28 20 |;...Disp|oseRgn( |
|00003410| 6d 61 73 6b 52 65 67 69 | 6f 6e 29 3b 0d 09 7d 20 |maskRegi|on);..} |
|00003420| 65 6c 73 65 20 7b 0d 09 | 09 72 65 73 75 6c 74 20 |else {..|.result |
|00003430| 3d 20 6f 66 66 73 63 72 | 65 65 6e 2e 6d 61 6b 65 |= offscr|een.make|
|00003440| 50 49 43 54 28 20 6d 6f | 64 65 29 3b 0d 09 7d 0d |PICT( mo|de);..}.|
|00003450| 09 72 65 74 75 72 6e 20 | 72 65 73 75 6c 74 3b 0d |.return |result;.|
|00003460| 7d 0d 0d 76 6f 69 64 20 | 70 69 78 65 6c 69 7a 65 |}..void |pixelize|
|00003470| 5f 73 68 65 6c 6c 3a 3a | 57 72 69 74 65 50 69 63 |_shell::|WritePic|
|00003480| 74 46 69 6c 65 28 20 63 | 6f 6e 73 74 20 66 73 73 |tFile( c|onst fss|
|00003490| 70 65 63 20 26 74 68 65 | 66 73 73 70 65 63 2c 20 |pec &the|fsspec, |
|000034a0| 63 6f 6e 73 74 20 50 69 | 63 48 61 6e 64 6c 65 20 |const Pi|cHandle |
|000034b0| 74 68 65 50 49 43 54 29 | 20 63 6f 6e 73 74 0d 7b |thePICT)| const.{|
|000034c0| 0d 09 4f 53 45 72 72 20 | 65 72 72 20 3d 20 6e 6f |..OSErr |err = no|
|000034d0| 45 72 72 3b 0d 09 2f 2f | 0d 09 2f 2f 20 57 72 69 |Err;..//|..// Wri|
|000034e0| 74 65 20 61 20 50 49 43 | 54 20 48 65 61 64 65 72 |te a PIC|T Header|
|000034f0| 20 66 69 72 73 74 3a 0d | 09 2f 2f 20 28 74 6f 20 | first:.|.// (to |
|00003500| 62 65 20 73 61 66 65 2c | 20 77 65 20 77 72 69 74 |be safe,| we writ|
|00003510| 65 20 74 6f 20 61 20 74 | 65 6d 70 6f 72 61 72 79 |e to a t|emporary|
|00003520| 20 66 69 6c 65 29 0d 09 | 2f 2f 0d 09 2f 2f 20 42 | file)..|//..// B|
|00003530| 55 47 20 41 4c 45 52 54 | 21 20 42 55 47 20 41 4c |UG ALERT|! BUG AL|
|00003540| 45 52 54 21 20 42 55 47 | 20 41 4c 45 52 54 21 20 |ERT! BUG| ALERT! |
|00003550| 42 55 47 20 41 4c 45 52 | 54 21 20 42 55 47 20 41 |BUG ALER|T! BUG A|
|00003560| 4c 45 52 54 21 20 42 55 | 47 20 41 4c 45 52 54 21 |LERT! BU|G ALERT!|
|00003570| 20 42 55 47 20 41 4c 45 | 52 54 21 0d 09 2f 2f 20 | BUG ALE|RT!..// |
|00003580| 42 55 47 20 41 4c 45 52 | 54 21 20 42 55 47 20 41 |BUG ALER|T! BUG A|
|00003590| 4c 45 52 54 21 20 42 55 | 47 20 41 4c 45 52 54 21 |LERT! BU|G ALERT!|
|000035a0| 20 42 55 47 20 41 4c 45 | 52 54 21 20 42 55 47 20 | BUG ALE|RT! BUG |
|000035b0| 41 4c 45 52 54 21 20 42 | 55 47 20 41 4c 45 52 54 |ALERT! B|UG ALERT|
|000035c0| 21 20 42 55 47 20 41 4c | 45 52 54 21 0d 09 2f 2f |! BUG AL|ERT!..//|
|000035d0| 20 42 55 47 20 41 4c 45 | 52 54 21 20 42 55 47 20 | BUG ALE|RT! BUG |
|000035e0| 41 4c 45 52 54 21 20 42 | 55 47 20 41 4c 45 52 54 |ALERT! B|UG ALERT|
|000035f0| 21 20 42 55 47 20 41 4c | 45 52 54 21 20 42 55 47 |! BUG AL|ERT! BUG|
|00003600| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00003610| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 0d 09 2f |T! BUG A|LERT!../|
|00003620| 2f 0d 09 2f 2f 09 09 57 | 65 20 75 73 65 20 61 20 |/..//..W|e use a |
|00003630| 6e 69 63 65 20 66 61 69 | 6c 2d 73 61 66 65 20 73 |nice fai|l-safe s|
|00003640| 74 72 61 74 65 67 79 20 | 68 65 72 65 2e 20 55 6e |trategy |here. Un|
|00003650| 66 6f 72 74 75 6e 61 74 | 65 6c 79 20 49 20 64 6f |fortunat|ely I do|
|00003660| 6e 27 74 20 6b 6e 6f 77 | 0d 09 2f 2f 09 09 77 68 |n't know|..//..wh|
|00003670| 65 74 68 65 72 20 74 68 | 61 74 20 66 61 69 6c 2d |ether th|at fail-|
|00003680| 73 61 66 65 20 73 74 72 | 61 74 65 67 79 20 77 69 |safe str|ategy wi|
|00003690| 6c 6c 20 77 6f 72 6b 20 | 77 68 65 6e 20 74 68 65 |ll work |when the|
|000036a0| 20 6f 72 69 67 69 6e 61 | 6c 20 66 69 6c 65 20 69 | origina|l file i|
|000036b0| 73 20 6e 6f 74 0d 09 2f | 2f 09 09 6f 6e 20 74 68 |s not../|/..on th|
|000036c0| 65 20 62 6f 6f 74 20 76 | 6f 6c 75 6d 65 2e 20 44 |e boot v|olume. D|
|000036d0| 6f 20 61 6c 6c 20 76 6f | 6c 75 6d 65 73 20 68 61 |o all vo|lumes ha|
|000036e0| 76 65 20 61 20 70 72 69 | 76 61 74 65 20 74 65 6d |ve a pri|vate tem|
|000036f0| 70 6f 72 61 72 79 20 69 | 74 65 6d 73 20 66 6f 6c |porary i|tems fol|
|00003700| 64 65 72 3f 0d 09 2f 2f | 0d 09 2f 2f 20 42 55 47 |der?..//|..// BUG|
|00003710| 20 41 4c 45 52 54 21 20 | 42 55 47 20 41 4c 45 52 | ALERT! |BUG ALER|
|00003720| 54 21 20 42 55 47 20 41 | 4c 45 52 54 21 20 42 55 |T! BUG A|LERT! BU|
|00003730| 47 20 41 4c 45 52 54 21 | 20 42 55 47 20 41 4c 45 |G ALERT!| BUG ALE|
|00003740| 52 54 21 20 42 55 47 20 | 41 4c 45 52 54 21 20 42 |RT! BUG |ALERT! B|
|00003750| 55 47 20 41 4c 45 52 54 | 21 0d 09 2f 2f 20 42 55 |UG ALERT|!..// BU|
|00003760| 47 20 41 4c 45 52 54 21 | 20 42 55 47 20 41 4c 45 |G ALERT!| BUG ALE|
|00003770| 52 54 21 20 42 55 47 20 | 41 4c 45 52 54 21 20 42 |RT! BUG |ALERT! B|
|00003780| 55 47 20 41 4c 45 52 54 | 21 20 42 55 47 20 41 4c |UG ALERT|! BUG AL|
|00003790| 45 52 54 21 20 42 55 47 | 20 41 4c 45 52 54 21 20 |ERT! BUG| ALERT! |
|000037a0| 42 55 47 20 41 4c 45 52 | 54 21 0d 09 2f 2f 20 42 |BUG ALER|T!..// B|
|000037b0| 55 47 20 41 4c 45 52 54 | 21 20 42 55 47 20 41 4c |UG ALERT|! BUG AL|
|000037c0| 45 52 54 21 20 42 55 47 | 20 41 4c 45 52 54 21 20 |ERT! BUG| ALERT! |
|000037d0| 42 55 47 20 41 4c 45 52 | 54 21 20 42 55 47 20 41 |BUG ALER|T! BUG A|
|000037e0| 4c 45 52 54 21 20 42 55 | 47 20 41 4c 45 52 54 21 |LERT! BU|G ALERT!|
|000037f0| 20 42 55 47 20 41 4c 45 | 52 54 21 0d 09 2f 2f 0d | BUG ALE|RT!..//.|
|00003800| 09 66 73 73 70 65 63 20 | 74 65 6d 70 46 69 6c 65 |.fsspec |tempFile|
|00003810| 28 20 6b 54 65 6d 70 6f | 72 61 72 79 46 6f 6c 64 |( kTempo|raryFold|
|00003820| 65 72 54 79 70 65 2c 20 | 22 5c 70 50 69 78 65 6c |erType, |"\pPixel|
|00003830| 69 7a 65 20 74 65 6d 70 | 22 20 2c 20 74 68 65 66 |ize temp|" , thef|
|00003840| 73 73 70 65 63 2e 76 52 | 65 66 4e 75 6d 29 3b 0d |sspec.vR|efNum);.|
|00003850| 0d 09 74 65 6d 70 46 69 | 6c 65 2e 43 72 65 61 74 |..tempFi|le.Creat|
|00003860| 65 55 6e 69 71 75 65 28 | 20 27 74 74 78 74 27 2c |eUnique(| 'ttxt',|
|00003870| 20 27 50 49 43 54 27 29 | 3b 0d 0d 09 61 63 63 65 | 'PICT')|;...acce|
|00003880| 73 73 5f 70 61 74 68 20 | 74 65 6d 70 41 63 65 73 |ss_path |tempAces|
|00003890| 73 28 20 74 65 6d 70 46 | 69 6c 65 2c 20 66 73 57 |s( tempF|ile, fsW|
|000038a0| 72 50 65 72 6d 29 3b 0d | 09 65 72 72 20 3d 20 74 |rPerm);.|.err = t|
|000038b0| 65 6d 70 41 63 65 73 73 | 28 29 3b 0d 0d 09 6c 6f |empAcess|();...lo|
|000038c0| 6e 67 20 46 69 76 65 4f | 6e 65 54 77 6f 20 3d 20 |ng FiveO|neTwo = |
|000038d0| 30 78 30 32 30 30 3b 0d | 09 50 74 72 20 68 65 61 |0x0200;.|.Ptr hea|
|000038e0| 64 65 72 20 3d 20 4e 65 | 77 50 74 72 43 6c 65 61 |der = Ne|wPtrClea|
|000038f0| 72 28 20 46 69 76 65 4f | 6e 65 54 77 6f 29 3b 0d |r( FiveO|neTwo);.|
|00003900| 09 65 72 72 20 3d 20 74 | 65 6d 70 41 63 65 73 73 |.err = t|empAcess|
|00003910| 2e 53 65 74 46 50 6f 73 | 28 20 30 78 30 30 30 30 |.SetFPos|( 0x0000|
|00003920| 29 3b 0d 0d 09 65 72 72 | 20 3d 20 74 65 6d 70 41 |);...err| = tempA|
|00003930| 63 65 73 73 2e 57 72 69 | 74 65 28 20 26 46 69 76 |cess.Wri|te( &Fiv|
|00003940| 65 4f 6e 65 54 77 6f 2c | 20 68 65 61 64 65 72 29 |eOneTwo,| header)|
|00003950| 3b 0d 0d 09 44 69 73 70 | 6f 73 65 50 74 72 28 20 |;...Disp|osePtr( |
|00003960| 68 65 61 64 65 72 29 3b | 0d 0d 09 69 66 28 20 65 |header);|...if( e|
|00003970| 72 72 20 3d 3d 20 6e 6f | 45 72 72 29 0d 09 7b 0d |rr == no|Err)..{.|
|00003980| 09 09 2f 2f 0d 09 09 2f | 2f 20 54 68 65 6e 20 77 |..//.../|/ Then w|
|00003990| 72 69 74 65 20 74 68 65 | 20 50 49 43 54 20 69 74 |rite the| PICT it|
|000039a0| 73 65 6c 66 3a 0d 09 09 | 2f 2f 0d 09 09 6c 6f 6e |self:...|//...lon|
|000039b0| 67 20 6e 65 77 5f 73 69 | 7a 65 20 3d 20 47 65 74 |g new_si|ze = Get|
|000039c0| 48 61 6e 64 6c 65 53 69 | 7a 65 28 20 28 48 61 6e |HandleSi|ze( (Han|
|000039d0| 64 6c 65 29 74 68 65 50 | 49 43 54 29 3b 0d 09 09 |dle)theP|ICT);...|
|000039e0| 65 72 72 20 3d 20 74 65 | 6d 70 41 63 65 73 73 2e |err = te|mpAcess.|
|000039f0| 53 65 74 45 4f 46 28 20 | 6e 65 77 5f 73 69 7a 65 |SetEOF( |new_size|
|00003a00| 20 2b 20 46 69 76 65 4f | 6e 65 54 77 6f 29 3b 0d | + FiveO|neTwo);.|
|00003a10| 09 09 65 72 72 20 3d 20 | 74 65 6d 70 41 63 65 73 |..err = |tempAces|
|00003a20| 73 2e 53 65 74 46 50 6f | 73 28 20 46 69 76 65 4f |s.SetFPo|s( FiveO|
|00003a30| 6e 65 54 77 6f 29 3b 0d | 0d 09 09 69 66 28 20 65 |neTwo);.|...if( e|
|00003a40| 72 72 20 3d 3d 20 6e 6f | 45 72 72 29 0d 09 09 7b |rr == no|Err)...{|
|00003a50| 0d 09 09 09 48 4c 6f 63 | 6b 28 20 28 48 61 6e 64 |....HLoc|k( (Hand|
|00003a60| 6c 65 29 74 68 65 50 49 | 43 54 29 3b 0d 09 09 09 |le)thePI|CT);....|
|00003a70| 09 65 72 72 20 3d 20 74 | 65 6d 70 41 63 65 73 73 |.err = t|empAcess|
|00003a80| 2e 57 72 69 74 65 28 20 | 26 6e 65 77 5f 73 69 7a |.Write( |&new_siz|
|00003a90| 65 2c 20 2a 28 48 61 6e | 64 6c 65 29 74 68 65 50 |e, *(Han|dle)theP|
|00003aa0| 49 43 54 29 3b 0d 09 09 | 09 48 55 6e 6c 6f 63 6b |ICT);...|.HUnlock|
|00003ab0| 28 20 28 48 61 6e 64 6c | 65 29 74 68 65 50 49 43 |( (Handl|e)thePIC|
|00003ac0| 54 29 3b 0d 09 09 7d 0d | 09 09 69 66 28 20 65 72 |T);...}.|..if( er|
|00003ad0| 72 20 3d 3d 20 6e 6f 45 | 72 72 29 0d 09 09 7b 0d |r == noE|rr)...{.|
|00003ae0| 09 09 09 65 72 72 20 3d | 20 74 65 6d 70 41 63 65 |...err =| tempAce|
|00003af0| 73 73 2e 43 6c 6f 73 65 | 28 29 3b 0d 09 09 09 69 |ss.Close|();....i|
|00003b00| 66 28 20 65 72 72 20 3d | 3d 20 6e 6f 45 72 72 29 |f( err =|= noErr)|
|00003b10| 0d 09 09 09 7b 0d 09 09 | 09 09 65 72 72 20 3d 20 |....{...|..err = |
|00003b20| 74 65 6d 70 46 69 6c 65 | 2e 45 78 63 68 61 6e 67 |tempFile|.Exchang|
|00003b30| 65 46 69 6c 65 73 28 20 | 74 68 65 66 73 73 70 65 |eFiles( |thefsspe|
|00003b40| 63 29 3b 0d 09 09 09 7d | 0d 09 09 7d 0d 09 7d 0d |c);....}|...}..}.|
|00003b50| 09 74 65 6d 70 46 69 6c | 65 2e 44 65 6c 65 74 65 |.tempFil|e.Delete|
|00003b60| 28 29 3b 0d 7d 0d 0d 76 | 6f 69 64 20 70 69 78 65 |();.}..v|oid pixe|
|00003b70| 6c 69 7a 65 5f 73 68 65 | 6c 6c 3a 3a 57 72 69 74 |lize_she|ll::Writ|
|00003b80| 65 50 69 63 74 52 65 73 | 6f 75 72 63 65 28 20 63 |ePictRes|ource( c|
|00003b90| 6f 6e 73 74 20 66 73 73 | 70 65 63 20 26 74 68 65 |onst fss|pec &the|
|00003ba0| 66 73 73 70 65 63 2c 20 | 63 6f 6e 73 74 20 50 69 |fsspec, |const Pi|
|00003bb0| 63 48 61 6e 64 6c 65 20 | 74 68 65 50 49 43 54 29 |cHandle |thePICT)|
|00003bc0| 20 63 6f 6e 73 74 0d 7b | 0d 09 72 65 73 6f 75 72 | const.{|..resour|
|00003bd0| 63 65 66 69 6c 65 20 74 | 68 65 66 69 6c 65 28 20 |cefile t|hefile( |
|00003be0| 74 68 65 66 73 73 70 65 | 63 29 3b 0d 09 4f 53 45 |thefsspe|c);..OSE|
|00003bf0| 72 72 20 65 72 72 20 3d | 20 74 68 65 66 69 6c 65 |rr err =| thefile|
|00003c00| 2e 43 72 65 61 74 65 28 | 29 3b 0d 09 65 72 72 20 |.Create(|);..err |
|00003c10| 3d 20 74 68 65 66 69 6c | 65 2e 4f 70 65 6e 28 20 |= thefil|e.Open( |
|00003c20| 66 73 52 64 57 72 50 65 | 72 6d 29 3b 0d 09 65 72 |fsRdWrPe|rm);..er|
|00003c30| 72 20 3d 20 74 68 65 66 | 69 6c 65 2e 55 73 65 28 |r = thef|ile.Use(|
|00003c40| 29 3b 0d 09 69 66 28 20 | 65 72 72 20 3d 3d 20 6e |);..if( |err == n|
|00003c50| 6f 45 72 72 29 0d 09 7b | 0d 09 09 41 64 64 52 65 |oErr)..{|...AddRe|
|00003c60| 73 6f 75 72 63 65 28 20 | 28 48 61 6e 64 6c 65 29 |source( |(Handle)|
|00003c70| 74 68 65 50 49 43 54 2c | 20 27 50 49 43 54 27 2c |thePICT,| 'PICT',|
|00003c80| 20 55 6e 69 71 75 65 49 | 44 28 20 27 50 49 43 54 | UniqueI|D( 'PICT|
|00003c90| 27 29 2c 20 22 5c 70 43 | 6f 6e 76 65 72 74 65 64 |'), "\pC|onverted|
|00003ca0| 20 50 49 43 54 22 29 3b | 0d 09 09 65 72 72 20 3d | PICT");|...err =|
|00003cb0| 20 52 65 73 45 72 72 6f | 72 28 29 3b 0d 09 09 65 | ResErro|r();...e|
|00003cc0| 72 72 20 3d 20 74 68 65 | 66 69 6c 65 2e 55 70 64 |rr = the|file.Upd|
|00003cd0| 61 74 65 28 29 3b 0d 09 | 09 44 65 74 61 63 68 52 |ate();..|.DetachR|
|00003ce0| 65 73 6f 75 72 63 65 28 | 20 28 48 61 6e 64 6c 65 |esource(| (Handle|
|00003cf0| 29 74 68 65 50 49 43 54 | 29 3b 0d 09 09 65 72 72 |)thePICT|);...err|
|00003d00| 20 3d 20 74 68 65 66 69 | 6c 65 2e 43 6c 6f 73 65 | = thefi|le.Close|
|00003d10| 28 29 3b 0d 09 7d 0d 7d | 0d 00 00 00 00 00 00 00 |();..}.}|........|
|00003d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003d80| 00 00 01 00 00 00 03 62 | 00 00 02 62 00 00 00 7e |.......b|...b...~|
|00003d90| 00 00 00 02 0f 54 6f 20 | 62 65 20 62 61 63 6b 65 |.....To |be backe|
|00003da0| 64 20 75 70 01 00 00 00 | 00 1c 00 00 07 8b a8 3b |d up....|.......;|
|00003db0| 0b 70 69 78 65 6c 69 7a | 65 2e 63 70 02 00 00 00 |.pixeliz|e.cp....|
|00003dc0| 50 61 72 74 53 49 54 21 | 00 00 00 00 00 00 00 00 |PartSIT!|........|
|00003dd0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00003de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003df0| 00 00 ae d1 09 58 00 00 | 00 00 00 00 03 e0 4e 15 |.....X..|......N.|
|00003e00| a9 5f a5 45 aa 48 45 b7 | 00 00 00 00 00 52 00 18 |._.E.HE.|.....R..|
|00003e10| 01 0e 01 ac 10 00 01 a8 | 02 48 01 00 ff f8 ff f0 |........|.H......|
|00003e20| 00 00 00 00 00 60 00 00 | 00 00 00 00 00 00 00 00 |.....`..|........|
|00003e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 0f 00 00 00 |........|........|
|00003e40| 00 02 09 55 74 69 6c 69 | 74 69 65 73 01 00 00 00 |...Utili|ties....|
|00003e50| 00 08 00 00 19 0c a4 c6 | 2d a4 aa 2b b1 11 00 00 |........|-..+....|
|00003e60| 00 00 00 d5 00 53 01 95 | 01 6f 01 08 00 64 00 c0 |.....S..|.o...d..|
|00003e70| 01 80 ff fc ff ee 00 00 | 00 00 00 00 80 00 00 00 |........|........|
|00003e80| 00 00 00 18 00 01 00 16 | 00 00 18 a6 00 fa 00 7c |........|.......||
|00003e90| e4 10 00 00 07 72 65 73 | 75 6c 74 20 00 00 00 0a |.....res|ult ....|
|00003ea0| 00 00 06 6e ff ff 00 00 | 00 00 00 00 00 0a 00 00 |...n....|........|
|00003eb0| 34 46 02 2f 00 00 00 00 | 00 00 00 68 00 03 00 12 |4F./....|...h....|
|00003ec0| 00 00 34 46 02 2f 00 c7 | 3d 78 00 00 03 65 72 72 |..4F./..|=x...err|
|00003ed0| 00 2c 00 00 37 85 02 40 | 00 c7 3d 68 80 00 00 e7 |.,..7..@|..=h....|
|00003ee0| 02 3b 01 64 03 f7 94 20 | 00 00 00 00 00 01 00 02 |.;.d... |........|
|00003ef0| 00 80 09 74 65 6d 70 46 | 69 6c 65 20 00 28 00 00 |...tempF|ile .(..|
|00003f00| 38 00 02 44 00 c7 3d 00 | 80 00 01 83 02 45 01 ea |8..D..=.|.....E..|
|00003f10| 03 f7 94 20 00 00 00 00 | 00 00 09 74 65 6d 70 41 |... ....|...tempA|
|00003f20| 63 65 73 73 00 00 01 6e | 00 10 00 00 2e 6d 00 00 |cess...n|.....m..|
|00003f30| 2e 7a 0d 41 64 64 42 6c | 61 63 6b 57 68 69 74 65 |.z.AddBl|ackWhite|
|00003f40| 00 00 1e 1d 00 00 1e 28 | 0b 43 68 61 6e 67 65 44 |.......(|.ChangeD|
|00003f50| 65 70 74 68 00 00 21 5e | 00 00 21 68 0b 43 68 61 |epth..!^|..!h.Cha|
|00003f60| 6e 67 65 4d 6f 64 65 00 | 00 00 1f 1b 00 00 1f 29 |ngeMode.|.......)|
|00003f70| 0f 43 68 61 6e 67 65 53 | 61 6d 70 6c 69 6e 67 00 |.ChangeS|ampling.|
|00003f80| 00 00 30 97 00 00 30 a6 | 0f 63 6f 6e 76 65 72 74 |..0...0.|.convert|
|00003f90| 54 6f 50 69 78 4d 61 70 | 00 00 19 32 00 00 19 43 |ToPixMap|...2...C|
|00003fa0| 11 48 61 6e 64 6c 65 44 | 69 61 6c 6f 67 45 76 65 |.HandleD|ialogEve|
|00003fb0| 6e 74 00 00 04 9b 00 00 | 04 9f 05 6d 61 69 6e 00 |nt......|...main.|
|00003fc0| 00 00 08 00 00 00 08 07 | 07 4f 70 65 6e 44 6f 63 |........|.OpenDoc|
|00003fd0| 00 00 06 17 00 00 06 35 | 1f 70 69 78 65 6c 69 7a |.......5|.pixeliz|
|00003fe0| 65 5f 73 68 65 6c 6c 3a | 3a 70 69 78 65 6c 69 7a |e_shell:|:pixeliz|
|00003ff0| 65 5f 73 68 65 6c 6c 00 | 00 00 24 95 00 00 24 a1 |e_shell.|..$...$.|
|00004000| 0d 52 65 61 64 50 69 63 | 74 46 69 6c 65 00 00 00 |.ReadPic|tFile...|
|00004010| 26 e8 00 00 26 f8 11 52 | 65 61 64 50 69 63 74 52 |&...&..R|eadPictR|
|00004020| 65 73 6f 75 72 63 65 00 | 00 00 28 33 00 00 28 40 |esource.|..(3..(@|
|00004030| 0d 52 65 61 64 5f 70 67 | 6d 5f 66 69 6c 65 00 00 |.Read_pg|m_file..|
|00004040| 22 6f 00 00 22 79 0b 53 | 65 74 41 42 75 74 74 6f |"o.."y.S|etAButto|
|00004050| 6e 00 00 00 23 5e 00 00 | 23 68 0b 53 65 74 4f 6e |n...#^..|#h.SetOn|
|00004060| 6c 79 4f 6e 65 00 00 00 | 33 fd 00 00 34 0a 0d 57 |lyOne...|3...4..W|
|00004070| 72 69 74 65 50 69 63 74 | 46 69 6c 65 00 00 3b 01 |ritePict|File..;.|
|00004080| 00 00 3b 12 11 57 72 69 | 74 65 50 69 63 74 52 65 |..;..Wri|tePictRe|
|00004090| 73 6f 75 72 63 65 00 00 | 00 48 00 09 4d 6f 6e 61 |source..|.H..Mona|
|000040a0| 63 6f 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |co......|........|
|000040b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 06 00 04 |........|........|
|000040c0| 00 2a 00 03 02 fd 03 fd | 00 29 00 17 02 a1 02 b4 |.*......|.)......|
|000040d0| ad a4 90 31 00 00 02 48 | 00 00 02 48 00 00 00 00 |...1...H|...H....|
|000040e0| 00 00 00 00 01 00 00 00 | 03 62 00 00 02 62 00 00 |........|.b...b..|
|000040f0| 00 7e 01 0a 2b 0c 1e 1e | 00 00 00 1c 00 7e 00 02 |.~..+...|.....~..|
|00004100| 44 54 56 55 00 01 00 1a | 42 4b 50 54 00 01 00 32 |DTVU....|BKPT...2|
|00004110| 4d 50 53 52 00 01 00 4a | 74 e5 ff ff 00 00 00 00 |MPSR...J|t.......|
|00004120| 00 00 00 00 3f 9c ff ff | 00 00 00 38 00 00 00 00 |....?...|...8....|
|00004130| 77 fb ff ff 00 00 00 1c | 00 00 00 00 12 42 ff ff |w.......|.....B..|
|00004140| 00 00 00 2a 00 00 00 00 | 03 ef ff ff 00 00 00 a4 |...*....|........|
|00004150| 00 00 00 00 03 ed ff ff | 00 00 02 16 00 00 00 00 |........|........|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+